4_JAVA+Oracle面试题(有答案).docVIP

  • 153
  • 0
  • 约1.07万字
  • 约 14页
  • 2017-05-11 发布于河南
  • 举报
4_JAVAOracle面试题(有答案)

4_JAVA+Oracle面试题(有答案) 基础测试题 卷面上不能出现任何的涂写文字,所有的答案要求写在答题纸上,考卷不得带走。 选择题 1、 What will happen when you attempt to compile and run the following code? (D) public class Static { static { int x = 5; // 在static内有效 } static int x, y; // 初始化为0 public static void main(String args[]) { x--; // -1 myMethod(); System.out.println(x + y + ++x); } public static void myMethod() { y = x++ + ++x; // y=-1+1 x=1 } } A. compiletime error B. prints: 1 C. prints: 2 D、 prints: 3 E、 prints: 7 F、 prints: 8 将以上的程序分步进行执行: 1、 static int x, y; ? x = 0 ; y = 0 ; 2、 x--; ? x = -1 ; y = 0 ; 3、 y

文档评论(0)

1亿VIP精品文档

相关文档