VB.Net program to create an empty class

Here, we are going to learn how to create an empty class in VB.Net?
Submitted by Nidhi, on December 21, 2020

Here, we will create a Sample class with an empty body.

Program/Source Code:

The source code to create an empty class is given below. The given program is compiled and executed successfully.

'VB.Net program to create an empty class.

Class Sample
End Class

Module Module1
    Sub Main()
        Dim obj As New Sample

        Console.WriteLine("Type name: {0}", obj.GetType())
    End Sub
End Module


Type name: VbConsoleApp.Sample
Press any key to continue . . .


In the above program, we created a module Module1 that contains the Main() function. Here we created a class Sample with an empty body.

The Main() function is the entry point for the program. Here, we created an object obj of class Sample and called GetType() method with an object that will print the name of the class on the console screen.

VB.Net Basic Programs »



Comments and Discussions




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© some rights reserved.