Learn free java9 tutorials

Java9 Diamond operator anonymous inner class improvement with example

June 24, 2021 ·  2 min read

In this blog post, We are going to cover the Java9 features - Diamond Operator Improvement for allowing anonymous inner class with an example. java7 Diamond Operator Example  We can declare the diamond operator as follows. List<String> listjava6 = new ArrayList<String>(); // Before java7 ie Java6 or less List<String> listjava7 = new ArrayList<>(); // with java7 Left side is using Generics with a data type of String, Right side of the equal operator is raw type ArrayList and it inferred from left side type....

Java9 Features - Collection API Changes

June 23, 2021 ·  5 min read

In this tutorial, We are going to learn about the Java9 features - Collection API Improvements with examples. Java9 Collection API Improvements Java9 added minor API changes to java.util.List, java.util.Map, _java.util.Se_t interfaces. Added new static factory method - of(collection) and returns unmodified collection - List, Set and Map in iteration order. This method takes a list of parameters as inputs and return the unmodified collection of List, Set and Map respectively....

Java9 - learn Interface Private Static methods | java9 features tutorials

June 22, 2021 ·  3 min read

In this blog post, We are going to learn the java9 interface private methods and static methods with examples Java9 - Interface Improvements Java released many versions. I am going to describe how the interface is evolved from public modifier to private modifier and abstract methods only to non-abstract methods. Interface declaration before java7 version examples The interface has only constants and abstract methods public static final variables i.e constants...

Java9 - Optional Class Improvements with examples | Java9 Features

June 22, 2021 ·  3 min read

We already discussed Optional class introduced in Java8. java9 Optional Class Improvements In this article post, We are going to discuss enhanced features added to the java9 Optional class. With java9, Added few more features to existing Optional class in java8. java.util.Optional has below methods. stream() ifPresentOrElse() or() These methods are added to primitive Optional classes: OptionalInt, OptionalLong, OptionalDouble. Java9 Optional.Stream() method example This method allows converting Optional Object to Stream Object....

You'll get a notification every time a post gets published here.