Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

module descriptor file allowed import statements Why?

please anyone explain me module descriptor file allowed import Why?
what is the used of import statement in module descriptor file.

import java.util.*;

module superman {
}
like image 966
Ng Sharma Avatar asked Oct 26 '25 13:10

Ng Sharma


1 Answers

One use would be if you were using the provides directive:

module superman {
    provides com.github.me.superhero.Superhero with com.github.me.superhero.Batman;
    provides com.github.me.superhero.Superhero with com.github.me.superhero.IronMan;
}

Using an import would look like:

import com.github.me.superhero.*;

module superman {
    provides Superhero with Batman;
    provides Superhero with IronMan;
}
like image 66
Jacob G. Avatar answered Oct 29 '25 03:10

Jacob G.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!