Write a string concat() program

Write a string concat() program

Program
import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        String s1,s2;
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter String 1 : ");
        s1=sc.nextLine();
        System.out.print("Enter String 2 : ");
        s2=sc.nextLine();
        System.out.print(s1.concat(s2));
    }
}


Output:

Enter String 1 : Sateesh
Enter String 2 : Kumar
SateeshKumar


Strings Handling In Java



More Questions


177 . Write a string concat() program
178 . Write a string compareTo program
179 . Write a string compareToIgnoreCase() Program
180 . Write a string equals program
181 . Write a string equalsIgnoreCase() program
182 . Write a string startsWith() program
183 . Write a string endsWith() program
184 . Write a string indexOf() program
185 . Write a string lastIndexOf() program
186 . Write a String substring() program
187 . Write a string trim() program