Program for different methods of String concatenation
Program for different methods of String concatenation
This post demonstrates different way of concatenating strings in Java.
Method 1 : Using + operator
+ operator can be used to concatenate string. Example :
String str3 = str1 +" " + str2;
Method 2 : Using String concat() function
String class provides a concat() function that can be used for String concatenation. Example :
String str4 = str1.concat("…
View On WordPress







