Core Java
-
Find Java Set Element By Index
In Java, Sets do not permit the inclusion of duplicate elements. Key implementations of the Set interface encompass HashSet, TreeSet,…
Read More » -
Adding Minutes to Time in Java: Legacy Date API vs. Date Time API
In Java, handling time has evolved over the years, with the introduction of the Date Time API in Java 8,…
Read More » -
Java 21 Scoped Values
In Java programming, the essential task of sharing data among various components of an application running within a single thread…
Read More » -
Sequenced Collections in Java 21
Java has continuously evolved to meet the changing needs of developers. One area of constant improvement is the collections framework,…
Read More » -
Java 21 Unnamed Patterns and Variables
In the world of Java 21, the introduction of the unnamed patterns and variables feature (JEP-443) endeavors to achieve a…
Read More » -
Mock Same Method with Different Parameters
When creating a mock for a Java method, it proves beneficial to obtain varied responses depending on the provided parameters.…
Read More » -
Constructor Unit Testing with Mockito
Constructor unit testing with Mockito is a task Java developers come across really often. In this brief tutorial, we will…
Read More » -
JUnit Assert Regex Matches
JUnit is often the initial preference for developers when conducting unit tests on Java code. In practical situations, a frequent…
Read More » -
Test Main Method with JUnit
The entry point for any Java application is the main() method, and its structure can vary based on the application…
Read More » -
Create Java Objects Using Class Names
The Java Reflection API provides several methods to achieve this goal. Nevertheless, identifying the most appropriate one for the current…
Read More »