C# Tutorial
class FirstApp { public static void Main() { System.Console.WriteLine("Welcome to codingpointer.com to learn C#."); System.Console.ReadKey(); } }
Output:
Welcome to codingpointer.com to learn C#.
In this program, first line is to decare a class which is an object oriented construct.
Every executable C# program must include Main method in one of the classes. this method is the starting point for executing the program.
In C#, An application can have many number of classes but atleast one class must define a Main method.
static keyword declares the Main method is a global one and cab be called without creating an instance of the class.
void is the type modifier and states that Main method does not return any value.
Once executing this program prints the above output and waits for any key press.
csc command is used to compile the cs file into IL code.
C:> csc FirstApp.cs C:> FirstApp
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page