Menu
Question Index
...

Write a program to insert the string into the stringbuffer object at the given index.

Input (StringBuffer, String, Integer) Output (String)
'Prabhas', 'Rebel', 0 'RebelPrabhas'
'RaviTeja', 'idiot', 8 'RaviTejaidiot'
'Mahesh Babu', 'Pokiri', 7 'Mahesh PokiriBabu'



class InsertString
{
    public static void main(String s[])
    {
        StringBuffer stringbuffer = new StringBuffer("Prabhas");
        String str = "Rebel";
        int index = 0;
        System.out.println("After inserting the string into the stringbuffer object is : " + getResultantString(stringbuffer, str, index));

    }


    public static String getResultantString(StringBuffer input, String str, int index) {
    }

}

Doubts

Problems

Topic: Java StringBuffer insert() Method With Example

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App