Posted by : Sudhir Chekuri Saturday, 5 October 2013


VB.NET Class and Object

Class is a blueprint.
Object is an instance of a class
All the methods, variables and properties inside class are known as members of class.
Members of class can be accessed outside by creating the object for that class.

VB.NET class and object program

Module Module1
Public Class class1

Public Sub print()
Console.WriteLine("Hello world")
End Sub

End Class

Sub Main()

Dim o As New class1()
o.print()
Console.ReadLine()

End Sub
End Module

Output

Hello world

Explanation

A method named print inside class is called outside using object o.


Leave a Reply

Subscribe to Posts | Subscribe to Comments

Followers

Total Pageviews

Powered by Blogger.

Blog Archive

- Copyright © 2013 DevStudent - Metrominimalist - Powered by Blogger - Designed by Johanes Djogan -