P

Praveen Singh • 36.81K Points
Coach

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
  • Correct Answer - Option(D)
  • Views: 19
  • Filed under category JAVA

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.

Be the first to start discuss.


Question analytics