欢迎来到求知题库网 求知题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

class Parent {    
String one, two; 
public Parent(String a, String b){    
one = a;    
two = b;    } 
public void print(){ System.out.println(one); }    } 
public class Child extends Parent {    
public Child(String a, String b){    
super(a,b);    
} 
public void print(){ 
System.out.println(one + " to " + two);    
} 
public static void main(String arg[]){   
 Parent p = new Parent("south", "north");    
Parent t = new Child("east", "west");    
p.print();    
t.print();    
}    
} 
Which of the following is correct?()

    A. Cause error during compilation. 
    B. south         east 
    C. south to north     east to west    
    D. south to north      east    
    E. south     east to west

点击查看答案&解析

相关考题

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题