Question: I saw [this question](https://stackoverflow.com/questions/2327916/operator-in-java) a few minutes ago, and decided to take a look in the java String class to check if there was some overloading for the `+` operator.

I couldn't find anything, but I know I can do this

```
String ab = "ab";
String cd = "cd";
String both = ab + cd; //both = "abcd"

```

Where's that implemented?

Answer: 
This is special behavior documented in the [language specification](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#39990).

> 
> 15.18.1 String Concatenation Operator +
> 
> 
> If only one operand expression is of
>  type String, then string conversion is
>  performed on the other operand to
>  produce a string at run time. The
>  result is a reference to a String
>  object (newly created, unless the
>  expression is a compile-time constant
>  expression (§15.28))that is the
>  concatenation of the two operand
>  strings. The characters of the
>  left-hand operand precede the
>  characters of the right-hand operand
>  in the newly created string. If an
>  operand of type String is null, then
>  the string "null" is used instead of
>  that operand.
> 
> 
>
It's done at the language level. The Java Language Specification is [very specific about what string addition must do](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.18.1).