Java | Functions | Question 8

Last Updated :
Discuss
Comments
Predict the output of the following program. Java
class Test
{
    public static void main(String[] args)
    {
        StringBuffer a = new StringBuffer("geeks");
        StringBuffer b = new StringBuffer("forgeeks");
        a.delete(1,3);
        a.append(b);
        System.out.println(a);
    }
}
gsforgeeks
gksforgeeks
geksforgeeks
Compilation error
Share your thoughts in the comments