Java 9 sub-packages split across modules

后端 未结 1 1950
旧巷少年郎
旧巷少年郎 2021-01-15 20:58

In Java 9, can I split sub-packages across modules? For example, can I have com.example.foo in one module and com.example.foo.bar in another module

相关标签:
1条回答
  • 2021-01-15 21:43

    There's no such thing as a "sub-package". my.package and my.package.sub have nothing more in common than any two random packages: they just have similar names. See this answer which starts

    In reality there is no such thing as a sub-package in Java

    That being the case, yes you can include them in different modules.

    0 讨论(0)
提交回复
热议问题