OCP Java17 SE Developers 复习题12

============================  答案  ==============================

================================================================

================================================================

E.  Modules are required to have a module-info.java file at the root directory of the module. Option E matches this requirement.

============================  答案  ==============================

================================================================

================================================================

B.  Options A, C, and E are incorrect because they refer to directives that don't exist. The exports directive is used when allowing a package to be called by code outside of the module, making option B the correct answer. Notice that options D and F are incorrect because of requires.

============================  答案  ==============================

================================================================

================================================================

G.  The -m or --module option is used to specify the module and class name. The -p or --module-path option is used to specify the location of the modules. Option D would be correct if the rest of the command were correct. However, running a program requires specifying the package name with periods (.) instead of slashes. Since the command is incorrect, option G is correct.

============================  答案  ==============================

================================================================

================================================================

D.  A service consists of the service provider interface and logic to look up implementations using a service locator. This makes option D correct. Make sure you know that the service provider itself is the implementation, which is not considered part of the service.

============================  答案  ==============================

================================================================

================================================================

E, F.  Automatic modules are on the module path but do not have a module-info.java file. Named modules are on the module path and do have a module-info. Unnamed modules are on the classpath. Therefore, options E and F are correct.

============================  答案  =====

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值