因简书改版后无法添加扩展链接,20170309问题解析请到公众号查看,问题解析在公众号首发,公众号ID:weknow619。
package Mar2017;
public class Ques0310 {
static void test() {
System.out.println("test method in Test class");
}
public static void main(String[] args) {
Ques0310 test = new Ques0310();
test.test();
Sub sub = new Sub();
sub.test();
test = sub;
test.test();
sub = test;
sub.test();
}
}
class Sub extends Ques0310 {
static void test() {
System.out.println("test method in Sub class");
}
}
今日问题:
请问主程序运行结果是什么?