VB.NET TUTORIALS - VB.Net - Statements
VB.Net - Statements
ADVERTISEMENTS
Declaration Statements
S.N | Statements and Description | Example |
---|---|---|
1 | Dim Statement Declares and allocates storage space for one or more variables. |
|
2 | Const Statement Declares and defines one or more constants. |
|
3 | Enum Statement Declares an enumeration and defines the values of its members. |
|
4 | Class Statement Declares the name of a class and introduces the definition of the variables, properties, events, and procedures that the class comprises. |
|
5 | Structure Statement Declares the name of a structure and introduces the definition of the variables, properties, events, and procedures that the structure comprises. |
|
6 | Module Statement Declares the name of a module and introduces the definition of the variables, properties, events, and procedures that the module comprises. |
|
7 | Interface Statement Declares the name of an interface and introduces the definitions of the members that the interface comprises. |
|
8 | Function Statement Declares the name, parameters, and code that define a Function procedure. |
|
9 | Sub Statement Declares the name, parameters, and code that define a Sub procedure. |
|
10 | Declare Statement Declares a reference to a procedure implemented in an external file. |
|
11 | Operator Statement Declares the operator symbol, operands, and code that define an operator procedure on a class or structure. |
|
12 | Property Statement Declares the name of a property, and the property procedures used to store and retrieve the value of the property. |
|
13 | Event Statement Declares a user-defined event. |
|
14 | Delegate Statement Used to declare a delegate. |
|
ADVERTISEMENTS
Executable Statements
Module decisions Sub Main() 'local variable definition ' Dim a As Integer = 10 ' check the boolean condition using if statement ' If (a < 20) Then ' if condition is true then print the following ' Console.WriteLine("a is less than 20") End If Console.WriteLine("value of a is : {0}", a) Console.ReadLine() End Sub End ModuleADVERTISEMENTS