Category: Java

Lists are common data structures in Java. Elements in a List have a specific order and can include duplicate elements. List have different implementations based on different use cases. The two key ones are ArrayList and LinkedList. Novice programmers often tend to use both the implementations interchangeably. However, both ArrayList and LinkedList have significant differences […]Continue reading

Timer is a utility class as a facility for Threads to schedule tasks for future execution as a background thread. You can use this class to schedule tasks for one-time execution or for repeated execution at a regular interval. In this post, I’ll explain how to schedule tasks in Java applications using the Timer and […]Continue reading

In Java, the HashMap and HashTable are both data structures that store data in key value pairs. When you store data in these, the key value is hashed, then is used as an index for fast access to the stored data. HashMap vs Hashtable HashMap Hashtable Introduced in Java 1.2 Introduced in Java 1.0, considered […]Continue reading

Sorting collections in Java is a common task. Java provides several different ways we can sort Collections. In this article, we will discuss the options we have to sort collections in Java. Understanding the java.util.Collections.sort() Method The java.util.Collections.sort() method is a crucial utility in the Java programming language, designed to order elements within a list. […]Continue reading

Apache Maven is distributed in several formats. The simplest way to install Maven is to download a ready-made binary distribution archive and follow the installation instructions. Maven 3.3+ release requires JDK 1.7 or above to execute. General Requirements Java JDK must be installed on system. Java 1.7 or higher is needed for Maven. To verify the […]Continue reading

In this post, I will explain the Merge Sort algorithm and how to use it in Java. Sorting is the process of arranging data in ascending or descending order. Sorting becomes necessary while searching a particular record in database, a particular telephone number in telephone directory, words in a dictionary, and so on. In computer […]Continue reading

So your JUnit 5 tests are not running under Maven? You have JUnit 5 Tests which run fine from your IDE, but fail to run under Maven? Your test output looks like this: [INFO] ——————————————————- [INFO] T E S T S [INFO] ——————————————————- [INFO] [INFO] Results: [INFO] [INFO] Tests run: 0, Failures: 0, Errors: 0, […]Continue reading