A

Admin • 828.03K Points
Coach

Q. Find the output of below Java program:

Code:
public static int a;

public Main(){
a=10;
}

public static void printMe(){
System.out.println(a);
}

public static void main(String[] args) {
printMe();
}

}
  • (A) 0
  • (B) 10
  • (C) Error in Code
  • (D) Nothing is printed
  • Correct Answer - Option(A)
  • Views: 12
  • Filed under category Java
  • Hashtags:

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.