Specified value of character before the location of stringbuffer object - Java Quiz Question


Write a program to find the value of the character before the given location of stringbuffer object.

Input (StringBuffer, Integer) Output (Integer)
'google', 1 103
'orkut', 2 114
'yahoomail', 8 105



class StringBufferCodePointBefore
{
    public static void main(String s[])
    {
        StringBuffer sb = new StringBuffer("facebook");
        int codepoint = 5;
        System.out.println("Specified value of the character before the given location of stringbuffer object is : " + getResultantString(sb, codepoint));

    }


    public static int getResultantString(StringBuffer input, int codepoint) {
    }

}