java格林认证_Java考试格林练习试题

Java考试格林练习试题

question 6)

b19a53fe49eb91e3f636eb28ad5e0b23.png

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值