Java 9 Flashcards
What is JShell in Java 9?
The Java Shell tool (JShell) is an interactive tool for learning the Java programming language and prototyping Java code. JShell is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results. The tool is run from the command line.
What is REPL?
REPL stands for Read-Eval-Print Loop. It’s a tool which evaluates declarations, statements, and expressions as they are entered and immediately shows the results.
What is module in Java 9?
In Java 9, a new kind of programming component called module has been introduced. A module is a self-describing collection of code and data and has a name to identify it.
How modules are different than packages in Java 9 ?
Modules are the units that contains multiple packages and specify it’s services , exports and dependencies.
How does Java 9 provides backward compatibility with libraries that haven’t published themselves as modules ?
Though Automatic modules. Any JAR on the module path without module descriptor ends up as automatic module. It means a Java 8 jar can be required and the jar name will became the module name.
What is the default setting for Automatic modules regarding exporting packages and reading modules ?
As one purpose of automatic module is to provide backward compatibility with the module less dependencies, automatic modules exports all packages and include all other modules.