{

Learn free java9 tutorials


Java9 - How to declare Private Static methods in interface | java9 new features

February 28, 2022 ·  3 min read

In this blog post, Learn the java9 interface private methods and static methods with examples. Java released many versions. This post is about how the interface is evolved from public modifier to private modifier and abstract methods only to non-abstract methods. java7 Interface declaration version examples The interface has only constants and abstract methods before the java 7 version. Examples are public static final variables i.e constants public abstract methods - No implementation with method header....


Java9 - Collection API examples| new java features

February 28, 2022 ·  5 min read

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.Set 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 returns the unmodified collection of List, Set and Map respectively. Please see for more information JEP 269: Convenience Factory Methods for Collections....


Java9 - Optional Class new methods | Java9 Features

February 28, 2022 ·  4 min read

Related posts Optional class introduced in Java8. In this article post, We are going to discuss enhanced features added to the java9 Optional class. What are Optional Class Improvements in Java 9? Added a few more features to the existing Optional class in java9. java.util.Optional has below methods. stream() ifPresentOrElse() or() These methods are added to below primitive Optional classes in java9 OptionalInt [OptionalLong](/2018/08/java8-optionallong-class-example.html OptionalDouble. Java9 Optional Stream() method example Stream(a) method used to convert Optional Object to Stream Object....


Java9 Diamond operator anonymous inner class example

February 28, 2022 ·  3 min read

In this blog post, Cover the _Java9 features Diamond Operator Improvement for allowing anonymous inner class with an example. Let’s see how a diamond operator declares in java 7,8,9 versions 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 ie....


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