Skip to content

Tag Archives: java-puzzle

Friends! I recently appeared for OCA exam and scored 95%. Here i am sharing few techniques and exam question patterns which must be helping you… Read More
Consider following Java program: class GFG {     public static void main(String args[])     {         System.out.println("GeeksforGeeks");     } } GeeksforGeeks Explanation: 1)public: It is an access specifier which… Read More
We can measure the time taken by a function in Java with the help of java.lang.System.currentTimeMillis() method. This method returns the current time in millisecond.… Read More
A comment is a statement that is not executed by the compiler or the interpreter, but before the lexical transformation of the program in the… Read More
Predict the output of the program public class GFG {     private GFG(Object o) {         System.out.println("Object");     }     private GFG(double[] d) {         System.out.println("double array");     }     public static… Read More
Predict the output of the program import java.util.Random; public class GFG {     private static Random rd = new Random();      public static void main(String[] args) {… Read More
Find the output of the program public class GFG {     public static void main(String[] args) {     char x = 'X';     int i = 0;     System.out.print(true… Read More
Find the output of the program public class Multicast {     public static void main(String[] args) {     System.out.println((int) (char) (byte) -1);     } } This program is… Read More
Predict the output of the following program public class LongDivision {     public static void main(String[] args) {     final long MICROS_PER_DAY = 24 * 60 *… Read More
Problem 1 : Insert code in the given code segments to make the loop infinite. class GFG { public static void main(String s[]){ /* Insert… Read More
In x++, it increase the value of x by 1 and in x=x+1 it also increase the value of x by 1. But the question… Read More
Prerequisite: Equal and Hashcode Methods in Java , Why to override equal and hashcode methods hashCode and equals method are frequently asked in Java interviews.… Read More
In this article we will see, how can we play an audio file in pure java, here pure means, we are not going to use… Read More
In this article, we will learn about how to use other project’s utilities, classes, and members. Before proceeding let’s learn about some keywords. classpath Classpath… Read More
There are a few method calls in java that can be utilized to get the space related information about a disk drive. These methods used… Read More