ArrayList addAll Method

In this article, we will look at the ArrayList addAll method. ArrayList addAll() method is used to append all the elements of argument collection to the list at the end. ArrayList addAll() Method Similar to the ArrayList add() method, the addAll() method in ArrayList will take care of number of things automatically for us. It will … Read more

ArrayList clone() Method

Java ArrayList clone() method or java.util.ArrayList.clone() method is used to create a shallow copy of an ArrayList instance. We can also use this method to perform a deep copy of an ArrayList. In this post, we will learn how to use clone() method with different examples. 1. ArrayList clone() Below is the syntax of ArrayList clone() … Read more

ArrayList clear() Method – How to Empty or clear ArrayList in Java

In this article, we will look at the ArrayList clear() method to remove all the elements from the list 1. ArrayList clear() method Syntax Before we look in to more details, let’s look at the clear() method syntax from the ArrayList.The ArrayList clear() method will iterate through each element of the list and just sets … Read more

Java Collections Framework

In this article, we are going to understand Java collections and its various implementations like List, Queue, and Set. We will also cover Java Maps and its implementations. We will also see the benefits of the collection. Last, we will cover the collection improvement in Java 8, and cover a bit about Stream API. Java … Read more

ArrayList contains() Method

The arraylist contains() method is used to check if a specific value exists in an ArrayList or not. In this post, we will learn how to use ArrayList contains() method with examples. ArrayList contains() Method Below is the syntax of the contains() method, defined in ArrayList class: This method takes one object as its parameter. … Read more

ArrayList get() Method

In this article, we will look at the ArrayList get() method. We will learn how to get an element from a specific index from the ArrayList using the ArrayList.get() method. 1. ArrayList get() Method Before we get into details, let’s see the signature of the get() method from the JDK. The index shows the element … Read more

ArrayList add Method Example

In this article, we will look at the ArrayList add method. The ArrayList add method is used to add an element in the list. We will look at the different options in the add()method. 1. ArrayList Add() Method ArrayList provides the options to add any type of element to the list, but it’s always recommended … Read more

How to Create infinite stream with Java 8

Java 8 has brought a lot of features and Stream API is one of the most popular feature of the Java 8. In this post, we will see as how to create infinite stream with Java 8. Infinite stream with Java 8 There are mainly two methods defined in the Stream class to create infinite … Read more

How to write a Comparator as Lambda Expression

In this article, we will take a look at the different option to write a comparator as Lambda expression In Java. Java 8 provides a lot of features including the lambda expression and this article will use the same feature to write a comparator in Java. Comparator as Lambda Expression We use comparator when we … Read more

Java Regex Email Validation Example

In this post, we will talk about validation email using regex in Java. We will talk about different java regex email validation example.   Java Regex Email Validation Email validation using regex is a common task and many validation framework provides this feature. You may need to validate the email address before using it to … Read more

How to Convert Date to LocalDate

In this post we will look how to convert Date to LocalDate in Java. We will also convert LocalDateTime to Date. 1. Convert Date to LocalDate Java 8 introduces a new API to work with date and time. In this section, let’s see how to convert Date to LocalDate with Java. 1.1 Date To LocalDate … Read more