Question: Lab3.java X 1 package code; 3 import java.util.ArrayList; s public class Lab3 t 7 /* 75 COMPETENCY POINTS *Question 1: Define this method so it

 "Lab3.java X 1 package code; 3 import java.util.ArrayList; s public classLab3 t 7 /* 75 COMPETENCY POINTS *Question 1: Define this method

"Lab3.java X 1 package code; 3 import java.util.ArrayList; s public class Lab3 t 7 /* 75 COMPETENCY POINTS *Question 1: Define this method so it returns those strings from the ArrayList named list that do not contain the String named s. There are (at least) two ways to do this 1) use the contains(String) -boolean method 12 13 Ex. "Bookkeeper".contains( keep") returns true Ex "Bookkeeper".containsC idgfai returns false 2) use the indexOf(String)- int method *Ex Bookkeeper".indexOfC"keep") returns 4 15 18 19 Ex "Bookkeeper". indexOfC"idgfaj) returns -1 Example 1: If list is C"Leela" "Fry","Zoidberg", "Bender"] and s is "er. then the answer is C"Lsela","Fry Example 2: If list is C"Leela" "Fry","Zoidberg", "Bender"] and s is "e then the answer is ["Fry"] 25 Example 3: If list is C"Leela" "Fry","Zoidberg", "Bender"] and s is "XXZ then the answer is C"Lsela","Fry", "Zoidbera""Bender" 30 31 public ArrayList answer-new ArraylistO return answer; I edit this method to return the correct value in answerl 35 36 75 COMPETENCY POINTS Question 2: 38 *Return the lowest index for a String that has lengthlimit Return -1 if all the strings have length limit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!