Java 8 Stream.collect() – Stream.Collectors APIs Examples


Java 8 provides an extremely powerful abstract concept Stream with many useful mechanics for consuming and processing data in Java Collection. In the tutorial, We will do lots of examples to explore more the helpful of Stream API with Collectors operation on the specific topic: “Java 8 Stream Collector”.

What will we do?

  • Explore Stream Collect Method signatures
  • Apply Stream Collectors Util with Examples

Now let’s do more details!

Related posts:
Java 8 Stream Reduce Examples
Java 8 Stream FlatMap Examples

[Continue reading…] “Java 8 Stream.collect() – Stream.Collectors APIs Examples”

How to use Java 8 Stream Reduce Examples with List and Array


Java 8 provides an extremely powerful abstract concept Stream with many useful mechanics for consuming and processing data in Java Collection. In the tutorial, We will do lots of examples to explore more the helpful of Stream API with reduction operation on the specific topic: “Java 8 Stream Reduce Collection”.

What will we do?

  • Explain how Java 8 Stream Reduce work?
  • Apply Stream Reduction on Java List, Array

Now let’s do examples for more details!

Related posts:
Java 8 Stream FlatMap Examples
Stream Filter in Java 8

[Continue reading…] “How to use Java 8 Stream Reduce Examples with List and Array”

How to use Java 8 Stream FlatMap Examples with List, Array


In the tutorial, we will discover more aspect of Java 8 Stream API with flatMap() function by lots of examples.
What we will do:

  • Explain how Java 8 Stream FlatMap work?
  • Apply Stream FlatMap on Java List, Array

Now let’s do more details!

Related posts:
Java 8 Stream Map Examples
Java 8 Stream Filter Examples

[Continue reading…] “How to use Java 8 Stream FlatMap Examples with List, Array”

How to use Java 8 Stream Map Examples with a List or Array


Converting or transforming a List and Array Objects in Java is a common task when programming. In the tutorial, We show how to do the task with lots of Java examples code by 2 approaches:

  • Using Traditional Solution with basic Looping
  • Using a powerful API – Java 8 Stream Map

Now let’s do details with examples!

Related posts:
Java 8
Java 8 Streams

[Continue reading…] “How to use Java 8 Stream Map Examples with a List or Array”

Java – How to use Stream Filter in Java 8 with List & Array Examples


Java 8 provides an extremely powerful abstract concept Stream with many useful mechanics for consuming and processing data in Java Collection. In the tutorial, We will use lots of examples to explore more the helpful of Stream API with filtering function on the specific topic: “Filter Collection with Java 8 Stream”.

What will we do?

  • How to filter List with traditional approach?
  • Use Java 8 Stream to filter List and Array Objects
  • Apply filter() function with other util functions of Stream API in practice

Now let’s do examples for more details!

Related posts:
Java – How to find an element in a Java List Object by Examples
Java 8 Streams

[Continue reading…] “Java – How to use Stream Filter in Java 8 with List & Array Examples”

How to Sort Java List Objects by Date property with Examples


In the tutorial, We discuss how to Sort Java List Objects by Date property with difference Date types: java.util.Date(using SimpleDateFormat), LocalDate, LocalDateTime. Java provides 2 main approaches for sorting Java List with Comparator:

  • java.util.Collections.sort(List list, Comparator< ? super Customer> c): sorting the specified list according to the order providing by the specified comparator.
  • java.util.Collection.stream().sorted(Comparator< ? super T> comparator): returning a stream consisting of the elements of this stream, sorted according to the provided Comparator.

Let’s do more details with Java syntax examples (Java 7 and Java 8) by descending and ascending sorting order.

[Continue reading…] “How to Sort Java List Objects by Date property with Examples”

How to Sort an Array in Java with Examples


In the tutorial, we will discuss how to Sort an Array with Java in ascending and descending order. java.util.Arrays class provides a lot of Methods to sort an Array with difference types:

  • With Primitives Array, We use the method such as: static void sort(int[] a).
  • With String or Objects Array that implement Comparable, We use method: static void sort(Object[] a).
  • With Custom Object Array that no implement Comparable, We use method: sort(T[] a, Comparator< ? super T> c).

Let’s do more details with Java Array Sorting.

[Continue reading…] “How to Sort an Array in Java with Examples”

Java – Convert Excel File to/from JSON (String/File) – using Apache Poi + Jackson

In the tutorial, Grokonez shows how to convert Excel File to JSON String or JSON File and vice versa with Java language by examples.

[Continue reading…] “Java – Convert Excel File to/from JSON (String/File) – using Apache Poi + Jackson”

Java – Convert CSV File to/from JSON (String/File) – using Commons-CSV + Jackson

In the tutorial, Grokonez shows how to convert CSV File to JSON String or JSON File and vice versa with Java language by examples.

[Continue reading…] “Java – Convert CSV File to/from JSON (String/File) – using Commons-CSV + Jackson”