第5题
classParent{
voidprintMe(){
System.out.println("parent");
}
}
classChildextendsParent{
voidprintMe(){
System.out.println("child");
}
voidprintAll(){
super.printMe();
this.printMe();
printMe();
}
}
publicclassA{
publicstaticvoidmain(Stringargs[]){
ChildmyC=newChild();
myC.printAll();
}
}
第8题
第9题
classParent{
Stringone,two;
publicParent(Stringa,Stringb){
one=a;
two=b;}
publicvoidprint(){System.out.println(one);}}
publicclassChildextendsParent{
publicChild(Stringa,Stringb){
super(a,b);
}
publicvoidprint(){
System.out.println(one+"to"+two);
}
publicstaticvoidmain(Stringarg[]){
Parentp=newParent("south","north");
Parentt=newChild("east","west");
p.print();
t.print();
}
}
Whichofthefollowingiscorrect?()
第11题
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!