Java 9 New Features



Java modules
You can now use a link step between compile and runtime to create a runtime image of just that module using the jlink tool.
There is a new tool called jmod which allows you to create a module containing code and configuration, this is similar to the jar tool which only jars up code.
This would be useful for deploying different modules depending on the version of the SE being used by the client.

JShell
Java finally gets a REPL Read Eval Print Loop which can be run to test out java commands without the full blown dev environment.

X.509
JDK provides more flexibility to disable X.509 certificates chains based on SHA-1 signatures
Most signatures should move to an SHA-3

Plugins
Java plugin and applets and JavaFX are now marked as deprecated and will be removed in future. All applications that use this plugin should now consider moving to JNLP or Java Web Start

Language Changes
Effectively final variables can now be used with try-with-resources paradigms
The contents inside a diamond type definition can be omitted if it can be inferred when used with anonymous inner classes
Support has been added for private interface methods

Garbage Collection
All Garbage collection has been defaulted to G1 or Garbage First collector
ConcMarkSweep is now deprecated and can not be used on the Java command line

OS Process Control
You now have a class called ProcessHandle that will hold the OS process ID and other metrics of the Process you have spawned. You can also destroy the process and perform actions upon process completions.

Strings
The internal representation of a string is changing. It used to be each character was stored as 2 bytes to support Unicode string encoding now where possible it can be represented as a byte array with an encoding flag field.

Quick immutable collections
There are now static factory methods on the List Set and Map interfaces to create on the fly immutable List Sets or Maps
Ie
Set optionTypes = Set.of(“VanillaCall”,”VanillaPut”);

Spin Loop
If you are waiting for some event like waiting to acquire a lock you would usually have a while ( condition ) loop and if that condition does not come true you may wait for ever. Thread.onSpinWait() can be used in the while to signify or hint that you are waiting on something as opposed to working hard doing other code hinting at the difference between live lock and spinning.
There are other features that you can see in the Java documentation but these are the most useful for now.

People who enjoyed this article also enjoyed the following:


Naive Bayes classification AI algorithm
K-Means Clustering AI algorithm
Equity Derivatives tutorial
Fixed Income tutorial

And the following Trails:

C++
Java
python
Scala
Investment Banking tutorials

HOME
homeicon









By clicking Dismiss you accept that you may get a cookie that is used to improve your user experience and for analytics.
All data is anonymised. Our privacy page is here =>
Privacy Policy
This message is required under GDPR (General Data Protection Rules ) and the ICO (Information Commissioners Office).