Core Java
-
Construct HashMap from String
1. Introduction Java’s HashMap class is a widely used data structure that stores key-value pairs. In this tutorial, we’ll aim…
Read More » -
Getting Record Fields and Values with Reflection
1. Overview In the ever-evolving landscape of Java programming, mastering reflection is a crucial skill. Reflection empowers developers to dynamically…
Read More » -
Remove Line Breaks from a File in Java
Handling files is a common task, and sometimes it becomes necessary to manipulate the content within these files. One such…
Read More » -
Java 21: Unnamed Class & Instance Main
Java 21 introduces unnamed classes and instance main methods, enhancing simplicity and flexibility. Unnamed classes allow for quick, on-the-fly class…
Read More » -
Convert Char Array to Int Array in Java
One common task we could encounter is converting character arrays to integer arrays. There are several ways to convert a…
Read More » -
Rotate Arrays in Java
In Java, array rotation refers to shifting the elements of an array by a specified number of positions. This operation…
Read More » -
Compare Objects with Apache Commons Lang 3
Examining objects is fundamental in Java, as well as numerous other programming languages. This principle is pivotal for tasks like…
Read More » -
Round a Double to Two Decimal Places in Java
When working with financial or mathematical data in Java, it’s often necessary to truncate or round floating-point numbers to a…
Read More » -
Verify Java Interface contract using JUnit
Java interfaces define contracts that classes implementing those interfaces must adhere to. It ensures consistency and interoperability among different implementations.…
Read More » -
Deprecate Finalization in Java 18
With each new release, Java strives to enhance its features, performance, and maintainability. One such endeavour is Java Enhancement Proposal…
Read More »