Returning values from Functions
The return value from a VB function is normally set by assigning it to the
function name as in:
Public Function MyFunc() As Int32
MyFunc=42
End Function
With VB.Net an alternate format is also available:
Public Function MyFunc() As Int32
Return(42)
End Function
Initializers
Initializers allow you to specify values when variables are declared. For example:
Private mProp As Int32 = 42
Dim sTitle As String = "Default"
Dim dblRates() As Double = {5.0, 25.5, 62.7}
Constructors
A constructor on a class allows a set of values to be passed in when the class is created. This allows the class to initialize properly and eliminates the need to add code to check that required properties are set before other properties or methods are called.
Multithreading
It is possible to create multithreaded applications in VB.Net. With multithreading, for example, a long-running process can be spawned on a secondary thread while the main application thread continues to interact with the user. It is also possible to write Windows NT services natively in VB.Net rather than needing to use API calls or third-party controls.
Conclusion
The Visual Basic.NET language also provides a modernized, simplified syntax that
will make developers' code more robust, scalable and flexible. One of the most
important additions is object inheritance. In Visual Basic.NET, all managed types
derive from System.Object. The universal type system allows for greater interoperability,
also contributing to the enhanced power and flexibility found in Visual Basic.NET.
Comments