Write a program in java to demonstrate concat() method?

class StringConcat

{

                public static void main(String arg[])

                {

                                String s1="India ";

                                String s2=s1.concat("is great country");

                                System.out.println(s1);

                                System.out.println(s2);

                }

}

Concat() method.PNG

, , , , , ,

Leave a Reply