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
πŸ’¬ Discuss
βœ… Correct Answer: (D) Cimpletd

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
320
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Vishal Gupta
Publisher
πŸ“ˆ
85%
Success Rate