20170222问题解析请点击今日问题下方的“【Java每日一题】20170223”查看(问题解析在公众号首发,公众号ID:weknow619)
package Feb2017; public class Ques0223 {
public static void main(String[] args) {
Parent parent = new Sub();
parent.sum(1, 2); Sub sub = new Sub();
sub.sum(1, 2);
}
} class Parent{
public void sum(int num1, int... nums){
System.out.println("Parent... sum");
}
} class Sub extends Parent{
@Override
public void sum(int num1, int[] nums){
System.out.println("Sub... sum");
}
}
今日问题:
请问主程序是否有编译错误?(点击以下“【Java每日一题】20170223”查看20170222问题解析)
题目原发布于公众号、简书:【Java每日一题】20170223,【Java每日一题】20170223 (也可以扫描头像二维码查看)