Skip to content

Tag Archives: Java-Output

1) What is the output of following program? public class Test {     private static float temp()     {         public static float sum = 21;         return(--(sum));     }… Read More
Prerequisites: multi-threading in java , Life cycle and states of a thread , Joining threads in java , start() method in java 1) What could… Read More
Prerequisite :- Local inner classes , anonymous inner classes 1) What is the output of the following java program? public class Outer  {     public static… Read More
Prerequisite – Java Constructors 1) What is the output of the following program? class Helper {     private int data;     private Helper()     {         data = 5;… Read More
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
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
Predict the output of following Java programs: Question 1 : public class Base {     private int data;        public Base()     {         data = 5;     }… Read More
Prerequisite – Garbage Collection in Java Difficulty level : Intermediate In Java, object destruction is taken care by the Garbage Collector module and the objects… Read More
Difficulty level : Intermediate Predict the output of following Java Programs. Program 1: class Gfg {     // constructor     Gfg()     {         System.out.println("Geeksforgeeks");     }            static Gfg… Read More
Difficulty level : IntermediatePredict the output of following Java Programs.Program 1:  Java class GfG {     public static void main(String args[])     {         String s1 = new… Read More
Difficulty level : Intermediate Predict the output of following Java Programs. Program 1 : public class Calculator {     int num = 100;     public void calc(int… Read More
Difficulty level : Intermediate Predict the output of following Java Programs. Program 1: class First {     public First() {  System.out.println("a"); } }     class Second… Read More
Predict the output of following Java Programs.Program 1:   Java // Main.java public class Main {     public static void gfg(String s)     {             System.out.println("String");     }     public static… Read More
Till now in Java, we were playing with the integral part where we witnessed that the + operator behaves the same way as it was… Read More
Predict the output of following Java Programs: Question 1 // file name: Main.java    class Base {     protected void foo() {} }  class Derived extends… Read More

Start Your Coding Journey Now!