Question: 6. Write code for the following methods: (a) (10 points) Given a list, an integer start, and an integer end, the method subList should return

6. Write code for the following methods: (a) (10 points) Given a list, an integer "start", and an integer "end", the method subList should return a new list containing the elements from "start" up to but not including "end". For example, if we invoke this method on the list [ "a", "b", "c", "d"], with start =1 and end =3, the method should return [ "b", "c" ]. public static String[] subList(String[] 1ist, int start, int end) f (b) (10 points) Given a list of Strings, and a name that we are looking for, the method find should return the first position of that name in the list. For example, if the list is [ "Athar", "Bob", "Carl", "David", "David"], and we are looking for "David", the method should return 3 . If the name is not found in the list, the method should return 1. public static int find(String [] names, String name) \{
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
