Collections and Generics
© examsiri.com
Question : 51 of 53
Marks:
+1,
-0
Given:
What java.util.Arrays and/or java.util.Collections methods could you use to convert sa to a List and then search the List to find the index of the element whose value is "foo"? (Choose from one to three methods.)
import java.util.*;
class AlgaeDiesel {
  public static void main(String[] args) {
   String[] sa = {"foo", "bar", "baz" };
   /* insert method invocations here*/
  }
} What java.util.Arrays and/or java.util.Collections methods could you use to convert sa to a List and then search the List to find the index of the element whose value is "foo"? (Choose from one to three methods.)
Go to Question: