class Test {
public Test() {
}
public void show() {
System.out.println("Test.show()");
}
public void Display() {
System.out.println("Test.Display()");
}
}
public class myclass extends Test {
public myclass() {
}
public void show() {
System.out.println("myclass.show()");
}
public void sum() {
System.out.println("myclass.sum()");
}
public static void main(String[] args) {
Test t = new myclass();
t.show();
}
}
为什么t不能调用sum方法,t不是引用的myclass吗