Java 9 Modules - Requires and Exports

Published: 13 June 2018
on channel: Ambasoft Java
750
12

Java 9 Modules - Requires and Exports

module-info.java
-----------------
Requires - similar to import in package
This module x is dependent on module y
Module x requires module y to get compiled

requires java.base (default require)

--describe-module - used to show the module information

the scope of packages inside a module will be restricted only within that module
In order to expose the packages inside a module to a public scope, we need to use
"exports" keyword

------------

Multi module application
------------------------
1. moduleone
com.packageone
Wish
sayHello
2. moduletwo
com.packagetwo
GetWish
Main

moduletwo requires moduleone


Watch video Java 9 Modules - Requires and Exports online, duration hours minute second in high quality that is uploaded to the channel Ambasoft Java 13 June 2018. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 750 times and liked it 12 visitors.