Group Discounts available for 3+ students and Corporate Clients

introduction to Class & Members in vb.net

Class:

It is used to define a user defined reference type datatype member.

 

Syntax:

Class   Class Name

Members

. . . . .

End class

 

Note:

Members of the class is of two types

  • Instance members
  • Shared members

 

Instance members:

These members are binded to the objects defined for the class and they can be accessed using the object name.

 

Shared members:

These members belong to the class definition and they can be accessed using the class name.

Shared members will be loaded on the memory when the class definition is headed.

 

Object:

instance of a class is called as an object.

Note:

  • Objects occupy the physical memory
  • Objects are always isolated i.e. the values assigned for the members of one object will not be reflected for the members of other object.

 

Syntax:

Modifier object name as new Class Name ([. . .])

 

 

 

Variable:

These are the place holders for maintaining a value based on the data type used for defining the variable.

 

Syntax:

Modifier variable name as Datatype [=value]

 

Modifier:

These are the access specifiers which are used to control the access of the members.

 

 

Screenshot_23

 

Note:

All the above modifiers can be used within a module and class. But these modifiers can’t be used from the methods.

 

Ex:

Module M1

Public I as integer ‘valid’

Class C1

Public j as integer ‘valid’

End class

Sub main ( )

‘Public K as integer error

End sub

End module

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on introduction to Class & Members in vb.net"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Support


    Please Enter Your Details and Query.
    Three + 6