Namespaces and subnamespaces in C#

前端 未结 8 1097
鱼传尺愫
鱼传尺愫 2021-01-19 07:23

begginers question about C#.

In every program I have to include several namespaces, like:

using System;
using System.Collections.Generic;
using Syste         


        
8条回答
  •  一个人的身影
    2021-01-19 07:55

    Just an added example to make you understand clearly.

    A child Namespace cant be accessed by calling parent namespaces

    Namespace Main  //only code and classes are accessible
    {
      //code for Main Namespace
      Namespace subMain     //only code and classes are accessible
      {
         //code for subMain
         Namespace verySubMain  //only code and classes are accessible
         {
            //code for verySubMain
         }
         Namespace otherVerySubMain  //only code and classes are accessible
         {
            //code for otherVerySubMain
         }
      }
    }
    

提交回复
热议问题