Programming MCQS - QUESTION DETAILS

What is the output of System.out.println("Hello" + 1 + 2);?
A. Hello3
B. Hello12
C. Hello21
D. Compile error

Concatenation from left to right: "Hello" + 1 = "Hello1", then "Hello1" + 2 = "Hello21".

Similar Questions

What is the output of System.out.println(Math.floor(7.8));?






What is the purpose of the 'instanceof' operator in Java?






What is the role of the 'super' keyword in Java?






How do you close a file in C?






How do you declare an array of function pointers in C?






What is the role of the 'strcpy' function in C?






How do you declare a function pointer in C?






What is the purpose of the 'try-catch' block in Java?






What is Java?






What is the purpose of the 'this' keyword in Java?