平安科技笔试题.docxVIP

  • 133
  • 0
  • 约1.45万字
  • 约 29页
  • 2019-11-06 发布于广东
  • 举报
一单项选择题 下面代码输出什么? public class A { static{ System, out. print (A); } A(){ System, out. print (a); } } public class B extends A { static { System, out. print (B); } B(){ System, out. print (b); } } pub1ic class Test { public static void main(StringEJ args) { new B (); } } AaBb ABab BAba BbAa Aa Bb 子类继承父类,正确的是 子类能够继承父类的私有方法和私有状态 子类能够继承父类的protected方法,但不能继承父类的protected状态 子类能够继承父类的protected方法,也能够继承父类的protected状态 子类能够继承父类的非私有方法和非私有状态 下面代码输出什么? int i = 9; switch(i) { case 1: System, out. print ; default: System, out. print(Error); case 2: System, out. print (Good); case 3: System, out. print (Best);

文档评论(0)

1亿VIP精品文档

相关文档