Define Shared member of the class.
- It is member of the class which can be accessed without creating instance of the class.
- It belongs to the class and not to the instance of the class.
- You can add the shared attribute to any class variable.
The syntax is as followsPrivate Shared SharedVariable As Integer
- Shared variables are shared among all instances of a class.
- A shared procedure can be called without an instance of the class.
- It cannot access nonshared members of the class.
- Shared members can be accessed through an instance variable or by directly using the class name.