In a book am reading about String concatenation, they say that the '+' operator is overloaded in java (the only overloaded operator).How is it overloaded?
Asked
Active
Viewed 62 times
-2
-
12+13 and 12+"test" is interpreted differently – Darshan Lila Apr 17 '15 at 08:21
1 Answers
4
Overloading for + operator means that there are two different operations depending on the parameters.
- For numbers + is an addition
- For String + is a concatenation

Davide Lorenzo MARINO
- 26,420
- 4
- 39
- 56