What is the output of this Java program? class Test { int i; } class Main { public static void main(String args[]) { Test t…

What is the output of this Java program?

class Test {
   int i;
}
class Main {
   public static void main(String args[]) {
      Test t;
      System.out.println(t.i);
   }
}
  1. a) 0
  2. b) A garbage value
  3. c) compiler error
  4. d) runtime error

From the Combined Bank Assistant Programmer (CSE) March 2021 – Preliminary exam, question 11 of 86.

More from this paper