DEV Community

loizenai
loizenai

Posted on

Java 9 Tutorial

https://grokonez.com/java-9-tutorial

Java 9 Tutorial

With Platform Module System, New Tools, New Core Libraries, Client Technologies and Languages Updates ..., we all will be interested in how it makes many cool things for development.

*Note: To configure your IDE for working with Java 9, please visit:
How to configure Java 9 Support for Oxygen (4.7)

I. Java Platform Module System

Java 9 Module System, which is developed under Project Jigsaw, comes to us with the specific goal: to provide reliable configuration and strong flexible encapsulation. That helps application developers, library developers, or Java SE Platform implementors more easilier create a scalable platform, make greater platform integrity, and improve performance.

What is Module?
A module is a named, self-describing collection of:

  • code: packages containing types (Java classes, interfaces...)
  • data: resources and other kinds of static information.

In summary:

  • Class contains fields, methods.
  • Package contains Classes, Enums, Interfaces, configuration files...
  • Module contains Package and Other data resources.

Module system mechanism provides Readability and Accessibility that control how a module can read others and to be accessed by others.

There are three kinds of module: named module, unnamed module, automatic module.

Java has a java.util.ServiceLoader class that helps to locate service providers at runtime by searching in class path. Now we can also specify service providers and users defined in modules.

More details at: Java 9 Module System

II. Tools

1. Jshell - The Java Shell

Java 9 provides an interactive REPL (Read-Eval-Print Loop) tool to test code snippets rapidly without a test project or main method. So we can learn or evaluate Java features easily.

More at:

https://grokonez.com/java-9-tutorial

Java 9 Tutorial

Top comments (0)