JAVA 8 / NOTES</>↗Java 821 Jan 2024
The Collectors.maxBy() method is used to find the maximum element from a stream based on a certain comparator. It returns an Optional which contains the maximum element according to the provided comparator, or an empty Optional if there are no elements in the stream. Here’s a simple example where we have a list of integers, […]
JAVA 8 / NOTES</>↗Java 821 Jan 2024
The Collectors.minBy() method in Java 8 is used to find the minimum element from a stream of elements based on a certain comparator. It returns an Optional describing the minimum element of the stream, or an empty Optional if the stream is empty. Here’s an example of how to use Collectors.minBy(). Assume we have a […]
JAVA 8 / NOTES</>↗Java 821 Jan 2024
The Collectors.counting() method is a terminal operation that returns the count of elements in the particular stream where it is used. This is part of the java.util.stream.Collectors in Java 8. Here is a simple example of how to use Collectors.counting(). Suppose we have a list of strings, and we want to count the number of […]
JAVA 8 / NOTES</>↗Java 821 Jan 2024
The Collectors.toCollection() method is a static method in the java.util.stream.Collectors class of Java 8. This method is used with streams when you want to convert a list to another collection type. Here’s a simple example of how to use the method: package org.kodejava.stream; import java.util.*; import java.util.stream.Collectors; public class CollectorsToCollection { public static void main(String[] […]
ITEXT PDF / NOTES</>↗iText PDF21 Jan 2024
iText 8 is an open source library for creating and manipulating PDF files in Java. It’s a successor to iText 7, providing more advanced features and capabilities for transforming documents into PDF format. iText 8 supports the creation and manipulation of PDF documents, and offers various functionalities to enhance your PDF generation requirements. With iText […]
UTIL PACKAGE / NOTES</>↗Util Package21 Jan 2024
Base64 encoding scheme is designed to encode binary data, especially when that data needs to be stored and transferred over media that designed to deal with text. Base64 encoding helps to ensure that the data remains intact without modification during transport. Base64 is a group of similar binary-to-text encoding schemes that represent binary data in […]