Which operators are overloaded for the String class in Java?

  • * (repetition)
  • + (concatenation)
  • - (subtraction)
  • / (division)
In Java, the + operator is overloaded for the String class, allowing you to concatenate strings using the + operator. Other operators like *, -, and / are not overloaded for String and would result in compilation errors if used inappropriately.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *