
In VB.Net, we use classes to define a blueprint for a Data Type. The screen will pause and wait for the user to perform an action to close it.
This line will prevent the screen from closing or exiting soon after the program has been executed. This statement makes the program print the text Hello Guru99 on the console when executed. Remember this was imported into the code. The WriteLine method belongs to the Console class, and it is defined inside the System namespace. This is where we have specified the behavior of the primary method. It defines what the module will do when it is executed. This marks the entry point in all VB.Net programs. In this line, we defined the Main sub-procedure. A procedure can be a Function, Sub, Get, Set, AddHandler, Operator, RemoveHandler, or RaiseEvent. This means that the procedure will define the class behavior. It is inside procedures where you should define your executable code. A VB.Net module or class can have more than one procedures. Anyone reading through your code will find it easy to understand. Use them to explain the meaning of various statements in your code. The purpose of comments is to improve the readability of the code. The VB.Net compiler will not process this part. To mark it as a comment, we added a single quote (‘) to the beginning of the sentence. It is inside this module that you will be able to define the data and methods to be used by your program. Hence we must have a class module in every program. Here, we have declared a module named Module1. After that, we will be able to access all the methods that have been defined in that namespace without getting an error.
What we are doing is that we are including a namespace with the name System into our programming structure. This is called the namespace declaration.Let us discuss the various parts of the above program: