Menu
Question Index
...

Write a program to set the length of the given StringBuffer object.

Input (StringBuffer, Integer) Output (Integer)
'Anushka', 6 6
'Samantha', 9 9
'Kajal', 5 5



class SetLengthOfStringBuffer
{
    public static void main(String s[])
    {
        StringBuffer sb = new StringBuffer("Anushka");
        int length = 6;
        System.out.println("After setting the length of the given StringBuffer object is: " + getLengthOfStringBuffer(sb, length));

    }


    public static int getLengthOfStringBuffer(StringBuffer input, int length) {
    }

}

Doubts

Problems

Topic: Java setLength() Method In StringBuffer Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App