Section 20.7 Check Point Questions6 questions 

20.7.1
Are all the methods in the Collections class static?
20.7.2
Which of the following static methods in the Collections class are for lists, and which are for collections?
sort, binarySearch, reverse, shuffle, max, min, disjoint, frequency
20.7.3
Show the output of the following code:
import java.util.*;

public class Test {
  public static void main(String[] args) {
    List<String> list =
      Arrays.asList("yellow", "red", "green", "blue");
    Collections.reverse(list);
    System.out.println(list);

    List<String> list1 = 
      Arrays.asList("yellow", "red", "green", "blue");
    List<String> list2 = Arrays.asList("white", "black");
    Collections.copy(list1, list2);
    System.out.println(list1);

    Collection<String> c1 = Arrays.asList("red", "cyan");
    Collection<String> c2 = Arrays.asList("red", "blue");
    Collection<String> c3 = Arrays.asList("pink", "tan");
    System.out.println(Collections.disjoint(c1, c2));
    System.out.println(Collections.disjoint(c1, c3));

    Collection<String> collection = 
      Arrays.asList("red", "cyan", "red");
    System.out.println(Collections.frequency(collection, "red"));
  }
}
20.7.4
Which method can you use to sort the elements in an ArrayList or a LinkedList? Which method can you use to sort an array of strings?
20.7.5
Which method can you use to perform binary search for elements in an ArrayList or a LinkedList? Which method can you use to perform binary search for an array of strings?
20.7.6
Write a statement to find the largest element in an array of comparable objects.