Objects in VB.NET

What are Objects in VB.NET?



Objects in VB.net are instances of a class. Advantage of objects is that it can be used flexibly by referring the class name without the need to write code.
Every object that has its own Properties, Methods and Events. Properties of the object define the characteristics, the Methods define the procedure that can operate on a Object. The events are possible actions that can occur to an object

Module Module1
Sub Main()
Dim obj As New Subtr
End Sub
Public Class Subtr
Dim a As Integer = 100
Dim b As Integer = 10
Sub min()
Console.WriteLine("Subtraction of 100-10::" & a - b)
End Sub
End Class
End Module

Subtraction of 100-10::90

In the above example,obj is an instance of the class Subtr.Using this object the function min is used without writing any code.

Visual Basic Tutorial

Ask Questions

Ask Question