public class StringDemo{

    public static void main(String args[])
    {
        String s1 = new String(" Hello this is a new World of Strings");
        System.out.println(s1);
        System.out.println("Lenght of String:"+s1.length());
       
        StringBuffer sb = new StringBuffer("Welcome to the World of String Buffer");
        System.out.println(sb);
        System.out.println(sb.insert(24,'a'));
        System.out.println(sb.append("."));
        System.out.println(sb.reverse());
        System.out.println("Lenght of String" + sb.length());
    }   
}

0 comments:

Post a Comment

Digital Marketing

Subscribe to RSS Feed Follow me on Twitter!