☰ See All Chapters |
String Concatenation in Java
We can concatenate only matching types. We cannot concatenate String with StringBuilder/StringBuffer. We cannot concatenate StringBuilder with StringBuffer. We can concatenate String with only String. We can concatenate StringBuilder with only StringBuilder. We can concatenate StringBuffer with only StringBuffer.
String Concatenation
By + (string concatenation) operator
By concat() method
StringBuilder, StringBuffer Concatenation
By append() method : There are various overloaded append() methods present in StringBuilder, StringBuffer classes.

All Chapters