Blog

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

I’ve previously posted about defining Consumer Driven Contracts using the OpenAPI specification and Spring Cloud Contract. This approach works well because you can tie your contracts to your API specification, and also wire in a request validator into your contract tests. But one problem that remained is typically your OpenAPI specification will span multiple services. […]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