Question: Which statement replacing the comment will result in printing: B 2 ton ro B 2? String s1 = 2 B or not 2 B; String
Which statement replacing the comment will result in printing: B 2 ton ro B 2?
String s1 = "2 B or not 2 B";
String s2 = "";
for (int i = 0; i < s1.length(); i++) {
char ch = s1.charAt(i);
// replace with statement
}
System.out.println(s2);
| s1 = ch + s1; |
| s1 = s1 + ch; |
| s2 = ch + s2; |
| s2 = s2 + ch; |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
