天安面试题(去年).docxVIP

  • 37
  • 0
  • 约4.76千字
  • 约 8页
  • 2021-03-01 发布于天津
  • 举报
一、单选(4 X 10=40 分) 1 在如下源代码文件 Test.java中,哪个是正确的类定义? A、 public class test { public int x = 0; public test(i nt x) { this.x = x; } } B、 public class Test{ public int x=0; public Test(i nt x) { this.x = x; } } C、 public class Test extends T1, T2 { public int x = 0; public Test (i nt x) { this.x = x; } } D、 protected class Test exte nds T2{ public int x=0; public Test(i nt x){ this.x=x; } } 下面的代码段中,执行之后 i和j的值是什么? int i = 1; int j; j = i++; TOC \o 1-5 \h \z A、 1, 1 B、 1,2 C、 2, 1 D、 2, 2 3 .对于catch子句的排列,下列哪种是正确的 父类在先,子类在后 子类在先,父类在后 有继承关系的异常不能在同一个 try程序段内 如何排列都可以 4 给出一段程序,试判断哪个是正确的结果( ) public class

文档评论(0)

1亿VIP精品文档

相关文档