Practice Creating and Using Modules – Example - 13.7 | 13. Java Modules and the JPMS (Java Platform Module System) | Advance Programming In Java
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Creating and Using Modules – Example

13.7 - Creating and Using Modules – Example

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What directive is used to specify module dependencies?

💡 Hint: Think about what you need to indicate when a module uses another.

Question 2 Easy

What filename must be present for Java modules?

💡 Hint: It is the descriptor file for the module.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What file must a Java module include at its root?

module-info.class
module-info.java
module.config

💡 Hint: Think about the naming convention for descriptor files.

Question 2

True or False: The 'exports' directive allows access to any package within the module.

True
False

💡 Hint: Consider how specific the module's access controls are.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Design a new module called 'com.logger' that requires 'java.logging' and exports a package called 'com.logger.api'. Write the corresponding module-info.java file.

💡 Hint: Consider which functionalities you need from java.logging.

Challenge 2 Hard

Explain the impact of using 'exports' vs not using it within module-info.java on module accessibility.

💡 Hint: Think about internal APIs versus public APIs.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.