Data type:

It is used to specify the type of value that can be assigned to the member.  

Note: VB.Net supports two types of data types

  • The value type of data types
  • Reference type data types

 

Value type Data typesReference type Data types
1) Whenever a data type is derived from structure then it is said to be a value type data type.1) Whenever a data type is derived from a class definition then it is said to be a value type data type.
2) The variable information and the value will be maintained at the stack memory. Ex: public I as integer = 10I [10] s to 3 stack memory2) The variable information will be maintained at the stack memory and the value will be maintained at heap memory. Ex: public S as string = VB.NetS[H10T] 5105stack memory ----> [vbrowser] H107 heap memory
3) Inheritance is not supported3) Inheritance is supported.
4) Default values will be assigned. Ex: integer à 0Boolean à false4) Default value for any reference type member will be a null value.
5) value type data types are bytes, s bytes, integer, u integer, short, u short, long, double, decimal, Boolean, char, date time, enum & structure, etc.5) Reference type data types are string, object, interface, delegate, and class.

   

Observation:

  • The default modifier is private
  • A default data type is an object.

Inclined to build a profession as VB.Net Developer? Then here is the blog post on, explore VB.Net Training

DIM (Dimensions):

It is the same as a private modifier but the difference is the DIM modifier can be used anywhere within the application.

‘‘Demo on members

Imports system

Module Members ‘‘Demo

Class Test

Public is as an integer instance member

Public shared as integer shared member

End class

Sub main ( )

Test.s = 100

Dim t1 As New Test

t1.i = 1000

Dim t2 As New Test

t2.i = 2000

Console.Writeline (“{0}, {1}, {2}”, Test.S, t1.i, t2.i)

End sub

End Module  

Observation:

Dimension    

VB.Net Tutorials