Show what this program prints. Be exact and complete. Can you explain the behavior of each print statement? 1 2 3 4 5 6 7 public class Test { public static void main(String[] args) { System.out.println("39 + 3"); System.out.println(39 + 3); System.out.println("39" + 3); } }

Respuesta :

LRev

Answer:

39 + 3

42

393

Explanation:

In this line System.out.println("39 + 3"), the quotation marks are used to delimit a string, then when printed in the console the string is printed as-is.

In the next line: System.out.println(39 + 3), without the quotation marks, the 39+3 is treated as a normal addition and prints the result of the operation.

In the last line printed with the code System.out.println("39" + 3,; the symbol + is used to concatenate the string 39 with the number 3, since the string has no spaces they are printed together.