Java FPT Software (Fsoft) Academy Practice Test

Access More Questions
What does System.out.println(5 + 3); print?
Correct Answer:
8
Explanation:
When you add two integers in Java, the plus operator performs arithmetic addition. System.out.println prints the resulting value followed by a newline. Here, both operands are integers, so 5 + 3 equals 8, and that 8 is what gets printed. If one of the operands were a string, the plus operator would do string concatenation, producing something like "53" instead of a numeric 8. The other options come from those different possibilities or mistaken operations, but with two integers this expression yields 8.

Access more questions from this quiz

Continue to Java FPT Software (Fsoft) Academy Practice Test for more practice questions and the full quiz experience.

Access More Questions