Reputation: 119
I think that the unnamed package is part of the unnamed module, however I can't be sure as I can't find any answers online, so I posted my question here.
From https://docs.oracle.com/javase/tutorial/java/package/createpkgs.html:
If you do not use a package statement, your type ends up in an unnamed package. Generally speaking, an unnamed package is only for small or temporary applications or when you are just beginning the development process. Otherwise, classes and interfaces belong in named packages.
*Edit: The answer is that the unnamed package is part of the unnamed module
Upvotes: 0
Views: 554
Reputation: 719596
It is in a (the) unnamed module.
According to the Java 11 edition of the JLS 7.4.2
The host system must associate ordinary compilation units in an unnamed package with an unnamed module (§7.7.5), not a named module.
This is more authoritative than the Java Tutorial.
Upvotes: 2