模块是专为重用而设计的软件包容器,每个模块都包含一个模块描述符,其中包含有关的信息模块名称,模块依赖项(它所依赖的其他模块的名称)和它导出的包的名称,这些包只能由依赖的模块使用
p>
模块可以在名为“module-info.java”的文件中声明,该文件是模块描述符。
<strong>module com.tutorialspoint.app{ // Modules upon which the module "com.tutorialspoint.app" depends on requires com.tutorialspoint.services; // Packages exposed by this module that can be used by other modules exports com.tutorialspoint.app.util; }</strong>
以上就是Java 9中模块的优势是什么?的详细内容,更多请关注php中文网其它相关文章!
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号