-2

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?

1 Answers1

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