输出结果
public abstract class Exam4 {Exam4()
{
print();
}
abstract void print();
}
public class Exam4Sub extends Exam4{
int i=1;
void print()
{
System.out.println(i);
}
public static void main(String[] args) {
Exam4Sub e=new Exam4Sub();
e.print();
}
}
为什么打印出来的是
0
1