Arraylist
- add(int index, element)
- addAll(int index, Collection collection)
- size()
- clear()
- remove(int index)
- remove(element)
- get(int index)
- set(int index, element)
- indexOf(element)
- equals(element)
- hashCode()
- isEmpty()
import java.util.ArrayList;
ArrayList<String> list = new ArrayList<String>();
list.add("hi");
list.add("hey");
list.add("hello");
list.add("nice");
System.out.println(list);
list.add(1, "test");
System.out.println(list);
ArrayList<String> list2 = new ArrayList<String>();
list2.add("apple");
list2.add("orange");
list2.add("grape");
list2.add("pineapple");
System.out.println(list2);
list.addAll(3, list2);
System.out.println(list);
list.size();
list2.size();
list2.clear();
System.out.println(list2);
list.remove(2);
System.out.println(list);
list.add("nice");
System.out.println(list);
list.remove("nice");
System.out.println(list);
list.get(3);
// first element is actually the 0th index
list.set(4, new String("grapeskittlessuck?"));
System.out.println(list);
list.indexOf("orange");
list.indexOf("thisdoesntexist");
list.equals("doesnt equal");
list.hashCode();
list.isEmpty();
ArrayList<String> empty = new ArrayList<String>();
empty.isEmpty();