How has requires and exports changed in recent Java versions?

In recent Java versions, specifically with the introduction of the Java Platform Module System (JPMS) in Java 9, the concepts of `requires` and `exports` were introduced to enhance modularization of Java applications.

The `requires` keyword is used to specify dependencies between modules. It indicates that the current module depends on another module for it to function correctly. For instance, a module that needs to utilize the functionalities of a library would declare this using the `requires` statement.

The `exports` keyword, on the other hand, is used to determine what packages are accessible to other modules. By exporting a package, you allow other modules to access the public types defined in that package.

Below is a simple example of how `requires` and `exports` are used in a module descriptor:

        module my.module {
            requires another.module; // This module requires another.module to function
            exports my.package; // This package is publically accessible to other modules
        }
        

Java 9 Module System requires exports JPMS modularization