Home > Java > javaTutorial > body text

What are the advantages and disadvantages of the module system in Java 9?

PHPz
Release: 2023-08-28 18:29:02
forward
1086 people have browsed it

Java 9中的模块系统有哪些优点和缺点?

One of the big changes in the Java 9 version is the module system, which provides modularity for running on devices with less available memory JVM. The JVM only runs the modules and APIs required by the application.

<strong>module Module-Name {
   requires moduleName;
   exports packageName;
}</strong>
Copy after login

Here are some pros and cons of the module system.

Advantages of modules:

  • The main change in Java 9 is that it is now a modular JDK with , Modular source code and Modular Runtime Image's module system.
  • The internal API is hidden within a module.
  • The module system creates more opportunities for the development of projects that can handle
  • distributed data processing. For example, the new Java 9 has been used to build IoT solutions and Platform, where various data need to be processed simultaneously.
  • Modules in Java can now also set
  • methods to public inside the module and restrict access to ordinary users.
Disadvantages of the module:

    After the release of Java 9, previous Java versions will no longer be supported, and customers may need to spend time and resources migrating.
  • If a project is still in development, migration may not be too difficult. But for other solutions, migration can be a serious problem.
  • Interdependencies between program products and libraries have not yet been resolved, making it potentially difficult to install new products and uninstall old ones.

The above is the detailed content of What are the advantages and disadvantages of the module system in Java 9?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template