Learn to program in Visual Basic .NET, the right way

Classes - Class

What is a Class?

A Class in Visual Basic .NET represents an object.

Classes embody the ideas of object oriented programming. A class allows programmers to create their own data type by grouping together properties, methods, and events.

Example

The following is an example of a Class to represent a person:

Fiddle: Live Demo

Initialization

Classes will need to be initialized before you can access any of its members. Using the person example from above the following is an example of initializing the Class:

Fiddle: Live Demo