Return to site

JAVA CERTIFICATION QUESTION: Module definitions and automatic modules

=>The quiz experts explore the Java modular system and how it uses JAR files.

ยท java

Imagine you have the following nonmodular JAR file containing the compiled ๐ด๐‘›๐‘–๐‘š๐‘Ž๐‘™ class:

> ๐‘—๐‘Ž๐‘Ÿ -๐‘ก๐‘ฃ๐‘“ ๐‘Ž๐‘›๐‘–๐‘š๐‘Ž๐‘™-๐‘‘๐‘œ๐‘š๐‘Ž๐‘–๐‘›-1.0.๐‘—๐‘Ž๐‘Ÿ

๐‘€๐ธ๐‘‡๐ด-๐ผ๐‘๐น/๐‘€๐ด๐‘๐ผ๐น๐ธ๐‘†๐‘‡.๐‘€๐น

๐ด๐‘›๐‘–๐‘š๐‘Ž๐‘™.๐‘๐‘™๐‘Ž๐‘ ๐‘ 

While you were developing the modular application,

you created a module called ๐‘๐‘™๐‘–๐‘’๐‘›๐‘ก containing the class ๐‘Ž๐‘๐‘.๐‘€๐‘Ž๐‘–๐‘›.

The ๐‘๐‘™๐‘–๐‘’๐‘›๐‘ก module declares variables of the ๐ด๐‘›๐‘–๐‘š๐‘Ž๐‘™ class type and instances of that class.

The ๐‘€๐ธ๐‘‡๐ด-๐ผ๐‘๐น/๐‘€๐ด๐‘๐ผ๐น๐ธ๐‘†๐‘‡.๐‘€๐น does not contain module-related attributes.

Which module definition (if any) allows you to compile the ๐‘๐‘™๐‘–๐‘’๐‘›๐‘ก module

using the nonmodular JAR file as an automatic module?

Choose one.

๐€.

๐‘š๐‘œ๐‘‘๐‘ข๐‘™๐‘’ ๐‘๐‘™๐‘–๐‘’๐‘›๐‘ก {

ห‘ห‘๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘–๐‘Ÿ๐‘’๐‘  ๐‘Ž๐‘›๐‘–๐‘š๐‘Ž๐‘™-๐‘‘๐‘œ๐‘š๐‘Ž๐‘–๐‘›;

ห‘ห‘๐‘’๐‘ฅ๐‘๐‘œ๐‘Ÿ๐‘ก๐‘  ๐‘Ž๐‘๐‘;

}

๐.

๐‘š๐‘œ๐‘‘๐‘ข๐‘™๐‘’ ๐‘๐‘™๐‘–๐‘’๐‘›๐‘ก {

ห‘ห‘๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘–๐‘Ÿ๐‘’๐‘  ๐‘Ž๐‘›๐‘–๐‘š๐‘Ž๐‘™.๐‘‘๐‘œ๐‘š๐‘Ž๐‘–๐‘›;

ห‘ห‘๐‘’๐‘ฅ๐‘๐‘œ๐‘Ÿ๐‘ก๐‘  ๐‘Ž๐‘๐‘;

}

๐‚.

๐‘š๐‘œ๐‘‘๐‘ข๐‘™๐‘’ ๐‘๐‘™๐‘–๐‘’๐‘›๐‘ก {

ห‘ห‘๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘–๐‘Ÿ๐‘’๐‘  ๐‘Ž๐‘›๐‘–๐‘š๐‘Ž๐‘™-๐‘‘๐‘œ๐‘š๐‘Ž๐‘–๐‘›-1.0;

ห‘ห‘๐‘’๐‘ฅ๐‘๐‘œ๐‘Ÿ๐‘ก๐‘  ๐‘Ž๐‘๐‘;

}

๐ƒ.

๐‘š๐‘œ๐‘‘๐‘ข๐‘™๐‘’ ๐‘๐‘™๐‘–๐‘’๐‘›๐‘ก {

ห‘ห‘๐‘Ÿ๐‘’๐‘ž๐‘ข๐‘–๐‘Ÿ๐‘’๐‘  ๐‘Ž๐‘›๐‘–๐‘š๐‘Ž๐‘™-๐‘‘๐‘œ๐‘š๐‘Ž๐‘–๐‘›-1.0.๐‘—๐‘Ž๐‘Ÿ;

ห‘ห‘๐‘’๐‘ฅ๐‘๐‘œ๐‘Ÿ๐‘ก๐‘  ๐‘Ž๐‘๐‘;

}

๐„. The animal-domain-1.0.jar file may not be used as an automatic module.

ยทฦŽ uoแด‰ส‡do sแด‰ ษนวสsuษ ส‡ษ”วษนษนoษ” วษฅ๊“• ยทuoแด‰snเน…ษ”uo๊“›

All Posts
ร—

Almost doneโ€ฆ

We just sent you an email.ย Please click the link in the email to confirm your subscription!

OK