Search This Blog

Saturday, 7 September 2013

Basic Syntax Description of C#

Basic Syntax Description of C#


using System;

public class MyFirstProgram
{
    public static void Main()
    {
        Console.WriteLine("Hello Sanjay sir");
        Console.ReadLine();
    }
}
Here in this program there are following things to know
1).using System is the namespace for Console Class.
2).public static void Main() means that main() method is static and public is the access specifier for Main() method and static means that it doesnot take any object for its calling.Compiler directs calls the Main() method.
3).Console.WriteLine(“…”) means Console is a class of namespace and WriteLine() is a method of the class Console.This method is used for giving output.
4).Console.ReadLine() means that it takes a value from the keyboard .

No comments:

Popular Posts