Java考试格林练习试题

时间:2024-09-17 01:10:32 JAVA认证 我要投稿
  • 相关推荐

Java考试格林练习试题

  question 6)

Java考试格林练习试题

  which of the following are keywords or reserved words in java?

  1) if

  2) then

  3) goto

  4) while

  5) case

  question 7)

  which of the following are legal identifiers

  1) 2variable

  2) variable2

  3) _whatavariable

  4) _3_

  5) $anothervar

  6) #myvar

  question 8)

  what will happen when you compile and run the following code?

  public class myclass{ static int i; public static void main(string argv[]){ system.out.println(i); }}

  1) error variable i may not have been initialized

  2) null

  3) 1

  4) 0

  question 9)

  what will happen if you try to compile and run the following code?

  public class q { public static void main(string argv[]){ int anar[]=new int[]{1,2,3}; system.out.println(anar[1]); }}

  1) 1

  2) error anar is referenced before it is initialized

  3) 2

  4) error: size of array must be defined

  question 10)

  what will happen if you try to compile and run the following code?

  public class q { public static void main(string argv[]){ int anar[]=new int[5]; system.out.println(anar[0]); }}

  1) error: anar is referenced before it is initialized

  2) null

  3) 0

  4) 5

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

Java考试格林模拟试题10-22

Java考试格林练习题07-18

华为JAVA考试试题11-01

java考试试题及答案10-25

java认证考试试题及答案07-21

2017年java考试模拟试题05-31

出版考试初级练习试题10-25

2016年Java认证考试题09-23

2017年Java认证考试试题07-23

2017年JAVA考试试题及答案08-30