28. Consider the following method. public static String abMethod (String a, String b) int x = a.indexOf(b); while (x >=
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
28. Consider the following method. public static String abMethod (String a, String b) int x = a.indexOf(b); while (x >=
28. Consider the following method. public static String abMethod (String a, String b) int x = a.indexOf(b); while (x >= 0) a = a.substring(0, x) + a.substring (x + b.length()); x=a.indexOf(b); return a; What, if anything, is retumed by the method call abMethod ("sing the song", "ng") ? (A) "si" (B) "si the so". (C) "si the song" (D) "sig the sog" (E) Nothing is returned because a StringIndexOutOfBoundsException is thrown.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!