Linked List in Java
Linked List in Java is a Collection class and it implements the doubly linked list data structure. LinkedList class in Java extends an abstract class...
Linked List in Java is a Collection class and it implements the doubly linked list data structure. LinkedList class in Java extends an abstract class...
Both Array and ArrayList are very important and frequently used data structures in Java. The main difference between Array Vs ArrayList is that Array is...
In this article, we are going to see 3 ways to remove an element from ArrayList in Java that matches a certain condition. 1. Remove...
To filter a List in java before Java 8 requires iterating through a complete list and needs us to write many lines of code. After...
Here are few Java Iterator examples for your reference. Below are the three ways to iterate a List or Set in Java – iterator.hasNext()iterator.forEachRemaining() methodListIterator 1....
There are 2 ways to convert an Iterator to Stream in Java 8 – Use StreamSupport.stream to convert Iterator into a StreamUse StreamSupport.stream with Spliterator parameter 1. Iterator to Stream The Iterator interface has no spliterator() method. We...
Java provides many useful ways to get current date time, current date, or current time using newly introduced LocalDate, LocalDateTime and ZonedDateTime classes in Java 8 Date/Time API classes. In this article, I will show you how to...
Java 8 has added a new way to iterate over List or Collection, by using the new forEach() method of the new Stream class. You...
Introduction In the real world, you will come across a situation where you need to sort an ArrayList of POJO. For example - Student, Department,...
In Java, we can determine the size of a file with File, FileChannel, and Files. If you are using Java 7 or greater, it is recommended to you...
As a Java developer, you might have got a requirement to make a file read only in the Java program. When I started programming in...
Java and Null share an ill-fated bond. Almost every Java developer had troubles with the NullPointerException. In Java, the null variables, references, and collections are...
In Java, empty String and blank String are two different concepts. It's always confusing and tricky for Java beginners to check if a String is...
Introduction HashMap is a class that is available under traditional Collection and ConcurrentHashMap is a class that is added later under Concurrent Collections. ConcurrentHashMap is...
Table Of Content Introduction Java ExecutorService Implementations Creating ExecutorService Creating with Executors Factory Methods Directly create an ExecutorService ExecutorService Usage execute(Runnable) submit(Runnable) submit(Callable) invokeAny() invokeAll()...