Q. What will be the output of the following Java program?
package pkg;
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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Hxllo

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
104
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Praveen Singh
Publisher
πŸ“ˆ
91%
Success Rate