Menu
Question Index
...

Write a program to find the length and capacity of given StringBuffer object.

Input (StringBuffer) Output (String)
'How are you' 11, 27
'good morning' 12, 28
'meritcampus school' 18, 34



class LengthAndCapacityOfStringBuffer
{
    public static void main(String s[])
    {
        StringBuffer sb = new StringBuffer("How are you");
        System.out.println("The length and capacity of given StringBuffer object is : " + getLengthAndCapacity(sb));

    }


    public static String getLengthAndCapacity(StringBuffer input) {
    }

}

Doubts

Problems

Topic: Java StringBuffer length() And capacity() Methods

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App