What’s the Output?
Determine the output of each of the following statement groups:
a. String x = "testme"; x + = 33; System.out.println(x);
b. String y = "testme"; y + = (char) 33; System.out.println(y);
c. String s = "This is too hard!"; System.out.println(s.substring(0,8) + "not");
d. String r = "Check this out"; System.out.println(r.replace(' ', (char) 0).length());
e. String t = "XYZ"; String u = "xyz"; System.out.println(t == u); System.out.print(t.equals(u));
f. String m = new String ("XYZ"); String n = "XYZ"; System.out.println(m == n); System.out.println(m.equals(n));
g. StringBuilder p = new StringBuilder("Why Me?"); System.out.println(p.reverse().reverse());
h. String v = new String("Why Not Me?"); v + = (char) ('0' + v.length()); System.out.println(v);
i. StringBuilder w = new StringBuilder("One Pond"); System.out.println(w.replace(2,3, " Golden"));
j. String a = "test me"; String b = "me"; System.out.println(a.length() + a.indexOf(b));
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.