Q. What is the output of Java code snippet with a Ternary operator or Conditional operator?
Code:void show()
{
String name = true ? getName() : "FRANCE";
System.out.print(name);
}
void getName()
{
System.out.print("ENGLAND");
}
β
Correct Answer: (D)
Compiler error