Data Types and variables in

  • Share this blog:


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 types Reference 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 memory 2) 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 supported 3) Inheritance is supported.
4) Default values will be assigned. Ex: integer à 0Boolean à false 4) 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.



  • 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  



VB.Net Tutorials

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses


About Author
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.