What happens when you concatenate two strings in Java?

Last Updated :
Discuss
Comments

What happens when you concatenate two strings in Java?

A new object is created

The original string is changed

Compile-time error

JVM crashes

Share your thoughts in the comments