139. JAVA Program to Concatenate two strings using static.
How does this program work?
- This program is used to Concatenate two strings using static in java.
Here is the code
//To Concatenate two strings using static
import java.util.Scanner;public class string
{
public static void main(String args[] )
{
String s1,s2;
System.out.print("Enter First String:\n " );
Scanner sc=new Scanner(System.in );
s1=sc.nextLine();
System.out.print("Enter Second String:\n" );
s2=sc.nextLine();
System.out.println("concatenation of two strings are : " +s1.concat(s2));
}
}