You'll get OutOfMemoryError long before you even get a chance of doing that, unless you can allocate over 8 GB memory. A string of Integer.MAX_VALUE characters requires at least about 4 GB memory (16 bits * (2^31 - 1) + some object overhead, assuming that the char arrays are stored optimally in memory), and you would need at least double that to keep all the three strings in memory during the copy operation.

If it were possible to allocate that much memory, I think you would get NegativeArraySizeException from java.lang.String#concat(String) (which will try to create a char[] with negative length) or IndexOutOfBoundsException from java.lang.StringBuilder#append(String) (which calls java.lang.String#getChars which calls java.lang.System#arraycopy).

Interestingly java.lang.AbstractStringBuilder#expandCapacity might truncate the length to Integer.MAX_VALUE characters (although I'm not anymore 100% sure about that), but java.lang.AbstractStringBuilder#append will not call that method because newCount will be negative. I wonder if this is by design or by chance. I also think that it's best to throw an exception instead of truncating the string and corrupting data.

EDIT: I think I got it right now. A StringIndexOutOfBoundsException will not be throw even though I at first thought that it would.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org