Examveda
Examveda

What will be the output of the following Java code?
class output 
{
    public static void main(String args[])
    {
       StringBuffer s1 = new StringBuffer("Hello World");
       s1.insert(6 , "Good ");
       System.out.println(s1);
    }
}

A. HelloGoodWorld

B. HellGoodoWorld

C. HellGood oWorld

D. Hello Good World

Answer: Option D


This Question Belongs to Java Program >> Strings

Join The Discussion

Related Questions on Strings