Pages

Search This Blog

Simple Display Using Class


Public Class class1
    Dim n As Integer
    Sub New()
        Console.WriteLine("Inside Constructor...")
        Console.Write("Enter the value of n : ")
        n = CInt(Console.ReadLine())
    End Sub
    Sub display()
        Console.WriteLine("n= " + n.ToString())
    End Sub
End Class


Module DisplayUsingClass
    Sub Main()
        Dim obj As New class1
        obj.display()
        Console.ReadLine()
    End Sub
End Module

1 comment: