Vidyalelo
Java Programming · Q35

Strings

Programming · Java Programming · question 35

Q35

What could be output of the following fragment of 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
Answer
C.
9hellow
D.
Compilation error
E.
None of these

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board