Classes in C#
C# classes are the primary building blocks of the language.C# also provides some predefined set of classes and methods.These classes and Methods Provides various basis functionalities that you may want to implement in your Application.
Creating First "
Hello World" Program
Using System;
public class Hello
{
public static void Main(string []args)
{
Console.WriteLine("Hello,World!! \n");
Console.ReadLine();
}
}
Let us look at the various parts of the given Program:
The First Line of program
using System; the
using keyword is used to includes the
System namespace in the program.A program has multiple using statements.
In the Code Class Declaration includes the method, Main() That Will display the message ,"Hello,World !!" on your screen.
The next line defines the
Main methods which is the entry point for all C# programs.The
Main methods states what the class does when executed.
Some C# point -
- C# is case Sensitive
- All statement and Expression must end with a semicolon(;).
- The program start execution from " Main" Method.