300x250 AD TOP

helooo
Tagged under:

Structure Of C# program


     

1.using:-     Using as directive in C# can be used for importing namespaces to your classes.

2. namespace:-

Namespaces organize objects in an assembly. An assembly is a reusable, versionable and self-describing building block of a CLR application

The built-in libraries are organized within namespaces. Take the Console class. It is available within the System namespace. 

To call the static WriteLine() method of the Console class, we use its fully qualified name. Fully qualified names are object references that are prefixed with the name of the namespace where the object is defined.

Ex:

public class dotnetfact
{
    static void Main()
    {
        System.Console.WriteLine("Simple namespace example");
    }
}

3. Constructor:

 Constructor is a method which gets executed automatically when we create or instantiate object of that class having constructor.