Posted by: Sourav | August 4, 2016

A class example in VB.Net


Module Module1

Sub Main()
Dim student1 As student = New student(“Sourav”, “Bhattacharya”)
student1.printname()
Console.ReadLine()

End Sub

Class student
Dim firstname As String
Dim secondname As String
Sub New(ByVal firstname As String, ByVal secondname As String)
Me.firstname = firstname
Me.secondname = secondname

End Sub

Sub printname()
Console.WriteLine(“The student’s name is {0} {1}”, firstname, secondname)

End Sub

Protected Overrides Sub Finalize()

End Sub
End Class
End Module

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: