当前位置:首页 > C#教程 > C#进阶

C#命名空间使用关键字

using System;
using first_space;
using second_space;

namespace first_space {

   class abc {

      public void func() {
         Console.WriteLine("Inside first_space");
      }
   }
}

namespace second_space {

   class efg {

      public void func() {
         Console.WriteLine("Inside second_space");
      }
   }
}   

class TestClass {

   static void Main(string[] args) {
      abc fc = new abc();
      efg sc = new efg();
      fc.func();
      sc.func();
      Console.ReadKey();
   }
}

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!