Tag: java 8

  • flatMap with example in Java 8

    flatMap with example in Java 8: To know flatMap with example in Java 8 . please go for below steps. Stream can hold different data types In Java 8 like below example:

      But, the Collectors and Stream operations (distinct,filter, sum,…) do not support it, so, we need flatMap() to do the following conversion :

    […]

    Posted in: Java

  • Optional Class in Java 8

    Optional Class in Java 8: Introduced a new Optional class in java 8 ( java.util package). this class is used to represent a value is present or absent. The main advantage of this new construct is that No more too many null checks and NullPointerException. By using this we can avoids any runtime NullPointerExceptions which help us to […]

    Posted in: Java

  • Java 8 Example to filter a Map

    Java 8 Example to filter a Map Here we are going to learn that how to filter a map in java 8 Stream API. -An example to know that how it was without Java 8

    -In Java 8  Map.entrySet() can be convert in to a stream, follow by a filter() and collect() as below example.

    […]

    Posted in: Java

  • All new features of java 8

    All new features java 8 Look at the below list to know the all new features java 8 A)Change in Language: 1.Lambda Expressions|Functional Programming Lambda expressions provide anonymous function types to Java – Replace use of anonymous inner classes – Provide more functional style of programming in Java

    2.Extension Methods|Bringing Multiple Inheritance (of Functionality) to […]

    Posted in: Java