Java versions overview

Java and JVM don't stay. Every version bring some improvement in performance, standard API and language syntax. Some features evolving from preview stage to standard.

Java 9

Some new features of Java 9:
  • new tool
  • private methods in interfaces
  • module system
  • try with resource improvement
  • reactive streams for developing asynchronous, scalable and parallel applications
  • HTTP 2 client
  • factory methods for immutable list, set, map and Map.Entry
  • CompletableFuture API improvements
  • Process API improvements
// factory methods for immutable collections
List lst = List.of("str1","str2","str3");
Map map = Map.of(1,"str1",  2,"str2",  3,"str3");
// private methods public interface DemoInterface{ // ... private void method1(){ //... } private static void smethod(){ // ... } }
Stream.of(1,2,3,4,5,6,7,8,9,10).takeWhile(i -> i < 7 ) .forEach(System.out::println);
HttpClient client = HttpClient.newHttpClient(); HttpRequest req = HttpRequest.newBuilder(URI.create("http://www.google.com")) .header("User-Agent","Java") .GET() .build(); HttpResponse<String> resp = client.send(req, HttpResponse.BodyHandler.asString());

Java 10

Some new features of Java 10:
  • the var keyword, for define variables

Java 11

Some new features of Java 11:
  • Oracle JDK would no longer be free for commercial use
  • support version 10.0 of the Unicode Standard
  • local-variable syntax for lambda parameters
  • standardizes the Http CLient API
  • implementation of the Transport Layer Security (TLS)

Java 14

Some new features of Java 14:
  • switch expressions