C#嵌套命名空间

using System;using first_space;using first_space.second_space;namespace first_space {class abc {public void func() {

编程学习网为您整理以下代码实例,主要实现:C#嵌套命名空间,希望可以帮到各位朋友。

using System;
using first_space;
using first_space.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();
   }
}

本文标题为:C#嵌套命名空间

下一篇: C#条件指令

基础教程推荐