请教个继承的问题
class A
{
protected void Apro()
{
Console.WriteLine("A_Protected");
}
protected static void Ast()
{
Console.WriteLine("A_Static");
}
}
class B : A
{
protected new static void Ast()
{
Console.WriteLine("B_Static");
}
static void Main(string[] args)
{
A.Ast(); //可以。和下面区别在哪?
B.Ast();
A a = new A();
a.APro(); //为什么这样不可以?
B b = new B();
b.Apro();
}
}
为什么子类中用父类实例不能访问实例方法?静态方法可以?protected修饰符不是在子类中可见么?