R

Ram Sharma • 193.86K Points
Coach

Q. Predict the output of following Java program 

Code:
class Test {
  int i;
} 
class Main {
  public static void main(String args[]) { 
      Test t = new Test(); 
      System.out.println(t.i);
   } 
}
  • (A) garbage value
  • (B) 0
  • (C) compiler error
  • (D) runtime error
  • Correct Answer - Option(B)
  • Views: 149
  • Filed under category JAVA

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics