28. Consider the following method. public static String abMethod (String a, String b) int x = a.indexOf(b); while (x >=

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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 >=

Post by answerhappygod »

28 Consider The Following Method Public Static String Abmethod String A String B Int X A Indexof B While X 1
28 Consider The Following Method Public Static String Abmethod String A String B Int X A Indexof B While X 1 (20.13 KiB) Viewed 30 times
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!
Post Reply