☞We can join two or more strings by using the following two methods.
1. By + (string concatenation) operator 2. By concat() method
class ConcatExample1{
public static void main(String args[]){
String s1="inspire"+" "+"web"+" "+"soft";
System.out.println(s1);
}
}
inspire web soft
class ConcatExample1{
public static void main(String args[]){
String s1="Avlokan ";
String s2="Mohan";
String s3=s1.concat(s2);
System.out.println(s3);
}
}
Avlokan Mohan
class ConcatExample3{
public static void main(String args[]){
String s1=50+30+"inspirewebsoft"+25+25;
System.out.println(s1);
}
}
80inspirewebsoft2525