Sail E0 Webinar
Question
String str1 = "Kolkata".replace('k', 'a');In the above statement, the effect on string Kolkata is
Options:
A .  Displays error message
B .  All characters k are replaced by a.
C .  All characters a are replaced by k.
D .  The first occurrence of k is replaced by a.
Answer: Option B

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers