因簡書改版后無法添加擴展鏈接,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");
}
}
今日問題:
請問主程序運行結果是什么?