Using namespace : NameSpace : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » NameSpace »

 

Using namespace









    

/*
C# Programming Tips & Techniques
by Charles Wright, Kris Jamsa

Publisher: Osborne/McGraw-Hill (December 28, 2001)
ISBN: 0072193794
*/
using System;

namespace nsFirst
{
    public class NameSpaceDemo
    {
        static public void Main ()
        {
            nsSecond.clsClass cls = new nsSecond.clsClass ();
            for (nsNested.WeekDays x = nsNested.WeekDays.Sunday; x < nsNested.WeekDays.DaysInWeek; ++x)
                cls.ShowDay (x);
        }
    }
    namespace nsNested
    {
       public enum WeekDays
              {
                  Sunday, Monday, Tuesday, Wednesday,
                  Thursday, Friday, Saturday, DaysInWeek
              };
    }
}

namespace nsSecond
{
    class clsClass
    {
        public void ShowDay (nsFirst.nsNested.WeekDays day)
        {
            Console.WriteLine (day);
        }
    }
}



           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» NameSpace