A

Admin • 828.70K Points
Coach

Q. What could be output of the following fragment of code?

Code:
public class Test{
public static void main(String args[]){
String x = "hellow";
int y = 9;
System.out.println(x += y);
}
}
  • (A) Throws an exception as string and int are not compatible for addition
  • (B) hellow9
  • (C) 9hellow
  • (D) 9hellowD.Compilation error
  • Correct Answer - Option(B)
  • Views: 18
  • 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.