using statement and namespace

C# uses using statement to import namespace. Once a namespace is imported we can use its types with simple name(class name).


using System;
using A.B.C;

namespace A
{
    namespace B
    {
        namespace C
        {

            class MyClass
            {

            }
        }
    }
}

class Program
{
    
    static void Main(string[] args)
    {
        MyClass cls = new MyClass();
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.