Java Foundations — Question 17
Identify two valid data types for the operands of the addition (+) operator?
Answer options
- A. string
- B. boolean
- C. numeric
- D. array
Correct answer: A, C
Explanation
The addition (+) operator can concatenate strings and perform arithmetic operations on numeric types, making 'string' and 'numeric' the correct choices. In contrast, 'boolean' and 'array' are not valid data types for this operator as they do not support direct addition.