Multiple choice technology programming languages

What will be output from the following statements: System.out.println(1+2+”3”); System.out.println (“1”+2+3);

  1. 33,123

  2. 123,33

  3. 6,6

  4. Compilation Error

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Java evaluates arithmetic expressions from left to right. In 1+2+"3", the integers 1 and 2 are added to get 3, which is concatenated with "3" to yield "33". In "1"+2+3, the string "1" is concatenated with 2 and then 3, producing "123".