Question: 1. What is output by the following code? String s0 = Java; int i1 = s0.indexOf('a'); int i2 = s0.indexOf('a', i1); int i3 = s0.indexOf('a',
1.
What is output by the following code? String s0 = "Java"; int i1 = s0.indexOf('a'); int i2 = s0.indexOf('a', i1); int i3 = s0.indexOf('a', i1 + 1); System.out.print(i1 + " " + i2 + " " + i3);
2.
What is output by the following code? String s1 = "Java"; String s2 = ""; for (int i = 0; i < s1.length(); i++) { s2 += s1; } System.out.print(s2);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
