P

Priyanka Tomar • 35.28K Points
Coach

Q. What will be the output of the following Java program?
class main_class
{
public static void main(String args[])
{
int x = 9;
if (x == 9)
{
int x = 8;
System.out.println(x);
}
}
}

  • (A) 9
  • (B) 8
  • (C) Compilation error
  • (D) Runtime error
  • Correct Answer - Option(C)
  • Views: 112
  • 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.


Question analytics