Home / Programming MCQs / JAVA MCQs / Question

V

Vishal Gupta • 7.73K Points
Tutor III

Q. What will be the output of the following program?

Code:
public class Test2 {  
    public static void main(String[] args) {  
        StringBuffer s1 = new StringBuffer("Complete");  
        s1.setCharAt(1,'i');  
        s1.setCharAt(7,'d');  
        System.out.println(s1);  
     }  
 } 
(A) Iomplede
(B) Complete
(C) Coipletd
(D) Cimpletd

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.