SCJP刷题学习笔记(Part sixteen)

QUESTION 151
Which two statements are true about the Fork/Join Framework? (Choose two.)
A. The RecursiveTask subclass is used when a task does not need to return a result.
B. The Fork/Join framework can help you take advantage of multicore hardware.
C. The Fork/Join framework implements a work-stealing algorithm.
D. The Fork/Join solution when run on multicore hardware always performs faster than standard sequential
solution.
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.logicbig.com/tutorials/core-java-tutorial/java-multi-threading/fork-and-join.html
 
 
 
QUESTION 152
Which two statements are true about synchronization and locks? (Choose two.)
A. A thread automatically acquires the intrinsic lock on a synchronized statement when executed.
B. The intrinsic lock will be retained by a thread if return from a synchronized method is caused by an
uncaught exception.
C. A thread exclusively owns the intrinsic lock of an object between the time it acquires the lock and the
time it releases it.
D. A thread automatically acquires the intrinsic lock on a synchronized method’s object when entering that
method.
E. Threads cannot acquire intrinsic locks on classes.
Correct Answer: AB
Section: (none)
Explanation
Explanation/Reference:
Reference: https://docs.oracle.com/javase/tutorial/essential/concurrency/locksync.html
 
 
 
QUESTION 153
Given the code fragment:
//line n1
		Double d= str.average().getAsDouble();
		System.out.println("Average= "+d);

 

Which should be inserted into line n1 to print Average = 2.5 ?
A. IntStream str = S
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值