Saturday 3 January 2015

static void Main(string[] args)

The first word is static. The static keyword tells us that this method should be accesible without instantiating the class.

static Class:
If a class is static,  it can have static members, both functions and fields. A static class can't be instantiated, so in other words, it will work more as a grouping of related members than an actual class. You may choose to create a non-static class instead, but let it have certain static members. A non-static class can still be instantiated and used like a regular class, but you can't use a static member on an object of the class. A static class may only contain static members. 
Ex:
public static class Rectangle
{
    public static int CalculateArea(int width, int height)
    {
        return width * height;
    }
}

The next keyword is void, and tells us what this method should return. For instance, int could be an integer or a string of text, but in this case, we don't want our method to return anything, or void, which is the same as no type.
The next word is Main, which is simply the name of our method. This method is the so-called entry-point of our application, that is, the first piece of code to be executed.
string[] args After the name of a method, a set of arguments can be specified within a set of parentheses. In our example, our method takes only one argument, called args. The type of the argument is a string, or to be more precise, an array of strings.