Skip to content

Category Archives: Java

Prerequisite – Collections in Java 1) What is the output of the following program?  Java import java.util.*;   public class priorityQueue {     public static void… Read More
Java doesn’t have pointers; Java has references. Reference: A reference is a variable that refers to something else and can be used as an alias… Read More
Mutation testing is a white-box testing technique, which changes certain portions of the code to reveal possible faults. On a very high level, it is… Read More
Given a string, write a Java function to check if it is palindrome or not. A string is said to be palindrome if reverse of… Read More
Given a number n, find n-th Fibonacci Number. Note that n may be large. Examples: Input : 100 Output : 354224848179261915075 Input : 500 Output… Read More
SwingWorker is an abstract class developed for the Swing library of the Java programming language. It is used to perform lengthy GUI interaction tasks in… Read More
POJO classes POJO stands for Plain Old Java Object. It is an ordinary Java object, not bound by any special restriction other than those forced… Read More
Shutdown Hooks are a special construct that allows developers to plug in a piece of code to be executed when the JVM is shutting down.… Read More
  In this article, we will see how hashmap’s get and put method works internally. What operations are performed. How the hashing is done. How… Read More
1) What is the output of the following program? public class Test implements Runnable {     public void run()     {         System.out.printf("%d",3);     }     public static void main(String[]… Read More
There are multiple ways of writing and reading a text file. this is required while dealing with many applications. There are several ways to read… Read More
Prerequisite: Threads, Multi-threading The need for Callable There are two ways of creating threads – one by extending the Thread class and other by creating… Read More
HashMap<K, V> is a part of Java’s collection since Java 1.2. This class is found in java.util package. It provides the basic implementation of the… Read More
synchronized keyword is used to make the class or method thread-safe which means only one thread can have lock of synchronized method and use it,… Read More
In this article, we will learn what is yield(), join(), and sleep() methods in Java and what is the basic difference between these three. First,… Read More

Start Your Coding Journey Now!