Sunday, April 5, 2015

Introduction on C#

In this blog
1. We will learn the basic structure of a c# program.  Look at the program we used in the C# programming.

// Namespace Declaration

using System;

class MyClass
{
    public static void Main()
    {
        // Write to console, console means a place where we see the output
       // like a command prompt
        Console.WriteLine ("Welcome to www.iamwithdotnet.blogspot.in !"); 
    }
}


2. Understand the purpose of using System declaration - The namespace declaration,
using System, indicates that you are using the System namespace. If  you omit the using System, declaration, then you have to use the fully qualified name of the Console class. 
like System.Console.WriteLine("Welcome to www.iamwithdotnet.blogspot.in !"); 

A namespace is used to organize your code and is collection of classes, interfaces, structs, enums and delegates. We will discuss about namespaces in detail in a later session.
3. Purpose of Main() method - Main method is the entry point into your application.
Main() method is the gate way of your program, the first and foremost function to be called by your compiler.

No comments:

Post a Comment