[英]What's the difference between requires and requires transitive statements in Java 9?
[英]What is difference between requires public VS requires transitive in Java 9
我了解到,為了使用任何其他出口模塊,我們需要指定模塊的requires
:
module mymodule{
requires othermodule.xyz;
}
當othermodule
使用上thirdmodule
和mymodule
需要,作為好, othermodule
應該這樣定義傳遞依賴:
module othermodule {
requires transitive thirdmodule
}
但是,我已經看到許多網站在這種情況下使用public
關鍵字:
module othermodule {
requires public thirdmodule
}
兩種形式之間有什么區別? 即requires public
和requires transitive
?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.