πŸ“Š JAVA
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 World");
s1.insert(6 , "Good ");
System.out.println(s1);
}
}

Note : Output.class file is not in directory pkg.
  • (A) HelloGoodWorld
  • (B) ABC
  • (C) Compilation error
  • (D) Runtime error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Runtime error

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
71
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Praveen Singh
Publisher
πŸ“ˆ
81%
Success Rate