Home » Archives for Yatin » Page 30

Author Archives: Yatin

An experience full-stack engineer well versed with Core Java, Spring/Springboot, MVC, Security, AOP, Frontend (Angular & React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).

Java 8 Collect vs Reduce Example

Hello readers, this tutorial explains the concept of reducing and collecting in Streams and Collector’s API respectively. 1. Introduction 1.1 Stream’s reduce() Method Let’s take a look at the Streams API’s reduce() method and how it can be used to perform reduction operations on the streams of data.         1.1.1 What is ‘reducing’ in the context of ...

Read More »

Java 8 Comparator Example

Hello readers, this tutorial explains how to use Lambda expressions in order to improve the boilerplate code of the Comparator written for sorting the list collections.                     1. Introduction The comparator interface has undergone a major overhaul in Java8 while still retaining its essence which is to compare and sort objects ...

Read More »

Java 8 Consumer and Supplier Example

Hello readers, this tutorial explains the in-built functional interfaces (i.e. Consumer<T> and Supplier<T>) introduced in Java8. 1. Introduction These features are the functional interfaces (i.e. an interface with only one abstract method) which belongs to the java.util.function package.           1.1 What is Consumer? Consumer<T> is an in-built functional interface introduced in Java8 in the java.util.function package. ...

Read More »

Java 8 Convert a Stream to List Example

Hello readers, this tutorial explains how to convert a Stream to a List with the help of the following examples. 1. Introduction One of the common problem while working with the Stream API in Java 8 is how to convert a Stream to List in Java because there is no toList() method present in the Stream class. When developers are ...

Read More »

Java 8 Streams: allMatch(), anyMatch(), noneMatch() Example

Hello readers, Java 8 Matching with Streams tutorial explains how to match the elements in a stream using the allMatch(), anyMatch() and noneMatch() methods provided by the Streams API.                 Table Of Contents 1. Introduction 1.1 Stream.allMatch() method 1.2 Stream.anyMatch() method 1.3 Stream.noneMatch() method 2. Java 8 Streams Example 2.1 Tools Used 2.2 ...

Read More »

Java 8 Predicate Example

Hello readers, this tutorial explains Java 8 predicate example, which has been newly introduced in the java.util.function package. This package describes the Predicate’s usage with the help of multiple examples. 1. Introduction java.util.function.Predicate is the new functional interface defined in the java.util.function package. The Predicate is used in all the contexts where an object needs to be evaluated for a given ...

Read More »

Java UUID Generator Example

Hello readers, in this tutorial, we are generating the UUID using the Java and Java UUID Generator API. 1. Introduction UUID / GUID (Universally / Globally Unique Identifier) is frequently used in programming. Some of its usages are for creating random file names, session id in the web application, transaction id and for record’s primary keys in the database (i.e. ...

Read More »

Java Convert Csv to Excel File Example

Hello readers, in this tutorial, we are going to implement the Csv to Excel file conversion by using the Apache POI library. This tutorial will show developers how to write large data to an excel file using SXSSF. 1. Introduction SXSSF (Package Name: org.apache.poi.xssf.streaming) is an API compatible streaming extension of XSSF to be used when very large spreadsheets have ...

Read More »

Java Servlet File Download and File Upload Example

Hello readers, in this tutorial, we will show you how to set up the File Upload and Download functionality in a Servlet based Java web application.                     Table Of Contents 1. Introduction 1.1 What is Servlet? 1.2 Servlet File Upload 1.3 Servlet File Download 2. Java Servlet File Download and File ...

Read More »

Java Servlet Security Example

The @ServletSecurity annotation is used to define the access control or the security constraints to the servlets. In this tutorial, we will see how to configure the Basic Authentication in the servlets. 1. Introduction If developers are planning on using the Basic Authentication they must be aware that if they use the plain HTTP requests, the username, and password can ...

Read More »