Append the given character array to the stringbuffer object - Java Quiz Question


Write a program to append the given character array to the stringbuffer object.

Input (StringBuffer, char[] array) Output (String)
'java', {'p', 'o', 'i', 'n', 't'} 'javapoint'
'Arun', {'k', 'u', 'm', 'a', 'r'} 'Arunkumar'
'good ', {'b', 'o', 'y'} 'good boy'



class AppendCharArrayToStringBuffer
{
    public static void main(String s[])
    {
        StringBuffer sb = new StringBuffer("java");
        char[] str = new char[]{
        'p',
        'o',
        'i',
        'n',
        't'};
        System.out.println("After appending the given character array to StringBuffer object is : " + getResultantString(sb, str));

    }


    public static String getResultantString(StringBuffer sb, char[] str) {
    }

}