VB.NET tutorial- Object-Oriented Programming
Object-Oriented Programming (OOP)
Classes and objects
Object-Oriented Programming (OOP) is an import feature in VB.NET. Once we talk about OOP, We always focus on classes and objects. A class is a template that can be used to create an object. Therefore, object is the instance of the class.
Creating a class
To create a class, you must use class keyword followed by the name of the class.
A class can have two types of members-private and public members. Private member can’t be accessed by the code outside the class. In contrast, public member can be access by the code outside the class. To declare a private member, you can use private keyword and to declare a public member, you can use public keyword. Variables declared without private or public keyword are private members.
Private stnumber As Integer
Private stname As String
Private stsex As String
Public sub setnumber