JAVA认证

Java考试格林练习题

时间:2024-09-23 21:39:58 JAVA认证 我要投稿
  • 相关推荐

Java考试格林练习题

  question 11)

Java考试格林练习题

  what will be the result of attempting to compile and run the following code?

  abstract class minebase { abstract void amethod(); static int i;}public class mine extends minebase { public static void main(string argv[]){ int[] ar=new int[5]; for(i=0;i < ar.length;i++) system.out.println(ar[i]); }}

  1) a sequence of 5 0’s will be printed

  2) error: ar is used before it is initialized

  3) error mine must be declared abstract

  4) indexoutofboundes error

  question 12)

  what will be printed out if you attempt to compile and run the following code ?

  int i=1; switch (i) { case 0: system.out.println("zero"); break; case 1: system.out.println("one"); case 2: system.out.println("two"); default: system.out.println("default"); }

  1) one

  2) one, default

  3) one, two, default

  4) default

  question 13)

  what will be printed out if you attempt to compile and run the following code?

  int i=9;switch (i) { default: system.out.println("default"); case 0: system.out.println("zero"); break; case 1: system.out.println("one"); case 2: system.out.println("two");}

  1) default

  2) default, zero

  3) error default clause not defined

  4) no output displayed

【Java考试格林练习题】相关文章:

Sun java认证考试答案10-23

CAD考试练习题07-17

华为Java上机考试题08-19

Java与Java web的区别08-22

sun java认证考试题库09-04

计算机等级考试二级Java语言考试大纲10-04

2017年java程序员考试试题07-05

新gre考试填空练习题透析07-10

2017跟单员考试练习题及答案05-12

单证员考试练习题09-05