Category Archives: Java

What is the difference between web server and application server?

By | June 21, 2025

Web server vs application server 1: What is Web Server? When we have an application program that has static contents such as texts, images, audio, and video files, etc. Say, an HTML page (HTML, CSS, JS), we need an execution engine that would be able to execute the static contents called a web server. Example:… Read More »

Demystifying Virtual Thread Performance: Unveiling the Truth Beyond the Buzz

By | June 18, 2025

What is Virtual Thread in Java? The virtual thread is introduced in JDK 21 that helps to improve the application availability, throughput, and code quality on top of reducing the memory consumption. The virtual thread concept has gained a lot of attention in recent times, and much more programming languages are trying to update their… Read More »

Java Memory Leaks | What is memory leak in Java?

By | January 27, 2025

In Java, when the garbage collector fails to collect some unused objects that are still being referenced internally due to the developer’s mistake, this is called a memory leak. It becomes critical overtime; heap memory may keep growing and lead to application out of memory errors. Causes of memory leak in Java There are several… Read More »

What is inter thread communication in Java example

By | September 5, 2024

Inter thread communication in Java allows the multiple threads to communicate and coordinate with each other. It helps in a concurrent environment when multiple threads work together over shared resources. In Java, we can use the object’s class methods, such as wait(), notify() and notifyAll() to achieve inter-threaded communication. Object’s monitor Monitor is the lock… Read More »

Concurrent HashMap – Real life use of Concurrent HashMap

By | June 26, 2024

What is ConcurrentHashMap? In Java, ConcurrentHashMap is a class that implements the Map<K,V> interface, and it is synchronised. When we declare a HashMap<K,V> in Java, the JVM internally assigns 16 buckets of memory to it. In ConcurrentHashMap, the lock is on each of the 16 buckets, which facilitates multiple write operations on different buckets concurrently… Read More »

Java interview questions for 5 years experience – Java developer interview questions & answer

By | January 27, 2025

1. String vs. StringBuilder | When to use String and StringBuilder in Java? Feature String StringBuilder Definition String is an immutable class in Java, which means once an object is created, its value cannot be changed. StringBuilder is used to create mutable string objects, which means we can change the content of the StringBuilder object.… Read More »

Java custom annotation | How to create custom annotation in Java?

By | August 17, 2024

In Java, annotation is a form of metadata that provides information about the programs but it is not the part of the program itself. The annotations are used by compilers, development tools or runtime libraries for different purposes. We can write annotations with the help of the @ symbol followed by the annotation name. In… Read More »

Immutable object in Java- How to create immutable object in Java?

By | June 18, 2025

In Java, immutable objects are objects whose state cannot be changed once they are created; they will remain constant throughout the lifecycle of the object. It helps in terms of simplicity, thread-safety and security. For example, string objects, In Java, string objects are immutable. i.e., once they are initialized, they cannot be changed. To learn… Read More »