经过一番研究,我发现可以应用于类的唯一访问修饰符是:
- public - 可在任何程序集中使用
- internal - 仅限于当前程序集中使用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test2343434
{
class Program
{
static void Main(string[] args)
{
Tools.ToolManager toolManager = new Tools.ToolManager();
Console.ReadLine();
}
}
}
namespace Tools
{
//error: Elements defined in a namespace cannot be explicitly
//declared as private, protected, or protected internal
private class ToolManager
{
public ToolManager()
{
Console.WriteLine("inside tool manager");
}
}
}