Use your own namespace with using directive - CSharp Custom Type

CSharp examples for Custom Type:namespace

Description

Use your own namespace with using directive

Demo Code

using System;/*w  ww  . ja  va2s.  com*/
using n1;
using n2;
namespace n1 {
   class abc {
      public void func() {
         Console.WriteLine("Inside n1");
      }
   }
}
namespace n2 {
   class efg {
      public void func() {
         Console.WriteLine("Inside n2");
      }
   }
}
class TestClass {
   static void Main(string[] args) {
      abc fc = new abc();
      efg sc = new efg();
      fc.func();
      sc.func();
      Console.ReadKey();
   }
}

Result


Related Tutorials