A

Admin • 830.13K Points
Coach

Q. What will be the output of the following Java program?
class output
{
public static void main(String args[])
{
String s1 = "Hello";
String s2 = s1.replace('l','w');
System.out.println(s2);
}
}

  • (A) hello
  • (B) helwo
  • (C) hewlo
  • (D) hewwo
  • Correct Answer - Option(D)
  • Views: 26
  • Filed under category Java
  • Hashtags:

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.