π My Learning Journey
Learning progress chronologically
Friday, December 26, 2025 2 posts
Initialize Java Object In Java, objects are instances of classes, and there are multiple ways to initialize them. Below are some common methods to create and initialize objects in J...
import java.util.Map; import java.util.HashMap; /** * Main class to test the longest substring without repeating characters. */ public class Main { &n...
Thursday, December 25, 2025 2 posts
βThe Map.get() method in Java retrieves the value associated with a specific key in a map. If the key does not exist, it returns null . The return type of get() depends on the type of v...
The getOrDefault method in Java's Map interface provides a convenient way to retrieve a value for a given key. If the key is not present in the map, it returns a specified default value instea...
Thursday, December 18, 2025 1 post
Hereβs a complete, runnable Java program that benchmarks ArrayList vs LinkedList for add , get , and remove operations. It uses System.nanoTime() for timing and handles edge cases l...