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

 

class StringAppend

{

                public static void main(String arg[])

                {

                                StringBuffer s1=new StringBuffer("Vikrant ");

                                StringBuffer s2=s1.append("Kumar");

                                System.out.println(s1);

                                System.out.println(s2);

                }

}

Append() method.PNG

, , , , ,

Leave a Reply