adplus-dvertising
frame-decoration

Question

What is the output of this program?
    class output
    {
        public static void main(String args[])
        { 
           StringBuffer s1 = new StringBuffer("Hello");
           s1.setCharAt(1,x);
           System.out.println(s1);
        }
    }

a.

xello

b.

xxxxx

c.

Hxllo

d.

Hexlo

Posted under Java Programming

Answer: (c).Hxllo

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?