Category Archives: Java

What is JavaDoc tool? How to use JavaDoc?

The JavaDoc tool is a document generator tool that is used to generate standard documentation in HTML format. JavaDoc comes along with the Java Development Kit (JDK) and generates the API documentation for Java codes and provides information about classes, methods, fields, parameters and other elements of the Java codes. Syntax for JavaDoc | JavaDoc… Read More »

Java Memory Leak | What is memory leak in Java?

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

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

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 Question for experience – Java Developer

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 »

How to convert Java class file to source code

Java Decompiler A Java decompiler is a reverse engineering tool that can be used to convert Java bytecode back to Java source code. It became useful when we had the compiled Java classes (in the form of bytecode, typically stored in a.class file) but not the original source code. In this tutorial, we will learn… Read More »