Classes in VB.NET
Classes are types and Objects are instances of the Class. Classes and Objects are very much related to each other. Without objects you can't use a class.
Code:
Public Class Test
----- Variables
-----Methods
-----Properties
-----Events
End Class
Code:
Imports System.Console
Sub Main()
Dim obj As New Test()
'creating a object obj for Test class
obj.disp()
'calling the disp method using obj
Read()
End Sub
End Module
Public Class Test
'creating a class named Test
Sub disp()
'a method named disp in the class
Write("Welcome to OOP")
End Sub
End Class
Bookmarks