请java大神帮帮忙。。
风隐若现 2013-11-22 02:46:50 package simple;
public class test1 {
static int x=100;
static void m(){
System.out.println(x);
}
}
class test2 extends test1{
static int x=200;
static void m(){
System.out.println("x="+x);
System.out.println("super.x="+super.x);//出错了
super.m();// 出错了
}
public static void main(String args[]){
//test1 a=new test1()
test1 a=new test2();
a.m();
System.out.println(a.x);
}
}
为什么不能调用父类的方法跟属性了?