Question: Look at the following code: String str1 = To be, or not to be; String str2 = str1.replace('o', 'u'); System.out.println(str1); System.out.println(str2); You hear a fellow
Look at the following code:
String str1 = "To be, or not to be";
String str2 = str1.replace('o', 'u');
System.out.println(str1);
System.out.println(str2);
You hear a fellow student claim that the code will display the following:
Tu be ur nut tu be
Tu be ur nut tu be
Is your fellow student right or wrong? Why?
Step by Step Solution
3.27 Rating (168 Votes )
There are 3 Steps involved in it
Solution The student is wrong The cod... View full answer
Get step-by-step solutions from verified subject matter experts
