1. Case Study: Vocabulary Comparison
  2. The Comparable Interface
    1. Collections.sort(words)
    2. Natural Ordering and compareTo
      1. Comparison Function
      2. Natural Ordering
    3. ArrayLists do not have natural ordering
      1. Comparable interface
      2. public interface Comparable<T> {public int compareTo(T other);}
      3. Collections.sort(); is in the Comparable interface
  3. ArrayLists
    1. basics
      1. no need to worry about add/remove strategies
    2. Generic Class
      1. ArrayList<E>
    3. Basic ArrayList Operations
      1. import java.util.*
    4. methods
      1. add
        1. add(index, <value>)
          1. expensive in time
      2. remove
        1. remove(index);
          1. expensive in time
      3. replace
        1. <name>.set(index, newValue)
      4. remove all
        1. clear
      5. no. of elements
        1. <name>.size()
      6. obtain item
        1. <name>.get(index)
    5. dynamic
    6. ArrayList Searching Methods
      1. contains
      2. indexOf
        1. first occurrence
      3. lastIndexOf
        1. index of last occurrence
    7. A Complete ArrayList Program
      1. stop words
    8. Adding to and Removing from an ArrayList
      1. intuitive way: adding from backwards
    9. Using the For-Each loop
      1. sequential problem
      2. iterate and modify cannot happen concurrently
      3. ConcurrentModificationException
    10. wrapper classes
      1. Arraylist<object type>
      2. wrapper class
        1. wraps(stores) primitive as an obj
        2. wrap: Integer y = new Integer(38);
        3. Unwrap: int number = y.intValue();
      3. boxing
        1. automatic conversion from primitive to object
        2. int to Integer
      4. unboxing
        1. wrapped obj to primitive data
        2. Integer to int