Q. What will be the output of the following Java code?
class output
{
public static void main(String args[])
{
StringBuffer sb=new StringBuffer("Hello");
sb.replace(1,3,"Java");
System.out.println(sb);
}
}

  • (A) Hello java
  • (B) Hellojava
  • (C) HJavalo
  • (D) Hjava
πŸ’¬ Discuss
βœ… Correct Answer: (C) HJavalo

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
123
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ritu Singhal
Publisher
πŸ“ˆ
90%
Success Rate