SCJP真题库更新17

QUESTION 81

Given:

 

and two separate command line invocations:

java Yippee

java Yippee 1 2 3 4

What is the result? 

A.      No output is produced.

1 2 3

B.    No output is produced.  

2 3 4

C.    No output is produced.

1 2 3 4

D.    An exception is thrown at runtime.

1 2 3

E.    An exception is thrown at runtime.

2 3 4

F.     An exception is thrown at runtime.

1 2 3 4

 

 

Answer: ( B )

 

QUESTION 82

Given:

 

What is the result? 

A. Compilation fails

B. An exception is thrown at runtime

C. doStuff x = 6 main x = 6

D. doStuff x = 5 main x = 5

E. doStuff x = 5 main x = 6

F. doStuff x = 6 main x = 5

 

 

Answer: ( D )

10行参数x是值传递不会改变mainx的值。

 

QUESTION 83

Given:

 

When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection? 

A. Line 5

B. Line 6

C. Line 7

D. Line 8

E. Line 9

F. Line 10

 

 

Answer: ( D )

栈内存用来存放基本类型的变量和对象的引用变量(对象的地址)

堆内存用来存放由new创建的对象和数组

 

 

QUESTION 84

Given:

 

What is the result? 

A.     Exception

B.    A, B, Exception

C.    Compilation fails because of an error in line 20.

D.    Compilation fails because of an error in line 14.

E.    A NullPointerException is thrown at runtime.

 

 

Answer: ( D )

改写的规定,子类抛出的异常要比父类的异常要小.本题中父类没有异常,子类也不能有异常.

 

QUESTION 85

Given:

What is the result? 

A. harrier

B. shepherd

C. retriever

D. Compilation fails  

E. retriever harrier

F. An exception is thrown at runtime.

 

Answer: ( D )

18行,case default: 语法错误,应改成default:

                                                                                      潮女时尚

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值