Getting started

In this tutorial you will learn how to find hidden files from given directory or drive in Java 8.
In below example we will remove null elements from ArrayList using java.util.stream.Stream.filter() method.

Java 8 added join() method in java.lang.String class to join Strings elements, It internally uses StringJoiner class for joining Strings elements.

It has two overloaded versions of join() methods. One accepts CharSequence elements and other accepts Iterable of CharSequence, it means you can pass List of String or an Array of String. Refer below three examples to join String values, list of string and an array of string.

In this tutorial you will learn how to find and replace file content using Java 8 Stream API. Read file as Stream then use map() method to returns new stream consisting of the results after replacing all occurrence of "foo" with "bar". then write this stream to file again.
In this tutorial you will learn about Java 8 Stream.map() method. Its a just conversion method where number of elements in the input and output streams is the same. Lambda expression is used as a argument, it is used to deal with each individual element in the stream. Its return a new Stream object containing the modified elements. e.g. define expression as map(n -> n * n) or map(s -> s.toUpperCase())
Learn how to create Stream using Stream.Builder.build() method. java.util.stream.Stream.Builder.build() method builds the stream and transitioning this builder to the built state. An IllegalStateException is thrown if there are further attempts to operate on the builder after it has entered the built state.
In this tutorial you will learn about min() and max() methods which returns an Optional instance. To obtain the value from Optional instance use get() method. It will return null value if stream has no elements. The min() and max() methods take a Comparator as a input parameter which compares the values using Comparator.comparing() method.
In this tutorials you will learn how to read File content line by line using Java 8 stream API's. Files.lines(Path path) method reads all lines from a file as a stream, and bytes from the file are decoded into characters using the standard charset.
In this tutorial you will learn how to extract distinct words from file using Java 8 Stream API. Files.lines() method returns a stream of strings from a specified file. Then further, we use to read each lines and splitting the words with the help of regular expression. Once all the words are separated then extract the distinct words from all the elements of the single stream produced by the flatMap().
In this tutorial you will learn about finding elements in a Stream base on Predicate condition with the help of Stream.findAny() and Stream.findFirst() methods.