namespace 屏蔽基类成员
{
internal class Program
{
class someClass
{
public string A = "属于some";
public void method()
{
Console.WriteLine("属于some的方法");
}
}
class otherClass : someClass
{
new public string A = "属于other";//屏蔽基类字段
new public void method()
{
Console.WriteLine("属于other的方法");
}//屏蔽基类方法
}
static void Main(string[] args)
{
Console.WriteLine(new otherClass().A);
new otherClass().method();
Console.ReadLine();
}
}
}