Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which operation can be used for both string concatenation and arithmetic addition in Java?

  1. +

  2. *

  3. -

  4. +=

The correct answer is: +

In Java, the + operator can be used for both string concatenation and arithmetic addition. This operator is most commonly associated with addition, but it can also be used to concatenate strings. The * and - operators are used for multiplication and subtraction, respectively. The += operator is a compound assignment operator, which combines addition and assignment. It is not used for string concatenation. Therefore, the correct answer would be A.