MCQ Single Best Answer Not Set

QWhat could be the 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);
        } 
}

ID: #2210 String in Java 2,683 views
Question Info
#2210Q ID
Not SetDifficulty
String in JavaTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Throws an exception as string and int are not compatible for addition
  • B hellow9
  • C 9hellow
  • D Compilation error
Correct Answer: Option B

Explanation

hellow9
No Previous Next Question

Share This Question

Challenge a friend or share with your study group.