C

Chandrakant • 6.73K Points
Tutor III

Q. What does the following string do to given string str1.

Code:
String str1 = “chandrakant”.replace(‘c’,’s’);
  • (A) Replaces single occurance of c to s
  • (B) Replaces all occurance of c to s
  • (C) Replaces single occurance of s to c
  • (D) None
  • Correct Answer - Option(B)
  • Views: 519
  • 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