ArrayLists

**__ArrayList__** An array list is a sequence of objects. Every element of the sequence can be accessed separately. Is modeled like an array, but is much easier than a regular array. An arrayList is a sequence of objects. The benefit of a ArrayList is that you can keep adding elements to it regardless of the size it was formerly. The size of the ArrayList will automatically increase and no information will be lost. The downfall is that it has no idea what type is stored. To find out the current size of an ArrayList use its size method. Because only objects can be used in ArrayList, wrapper classes are used instead of primitive data types. Integer, Boolean, Double are the wrapper classes that are used in the place of primitive data types. + Benefits 2 Not confined by type (ints, doubles, Miis, etc.) All in one list**
 * 1 It is resizable

- Downfall
 * No idea what type is stored**

Comparing Arrays and ArrayLists int[]name = new int[10];**
 * To make an Array:

ArrayList name = new ArrayList; To use an Array: set value name [0] = 3;**
 * To make an ArrayList:

**To use an ArrayList: name.set (0, 3); myMiis.set (5, bob);** You can't!**
 * To add values to an Array:

**To add values to an ArrayList: name. add (666); ^ adds to end

To remove a slot from an ArrayList: nums.remove(4);**

  **Brief intro to ArraysList Methods (Most are self-explanatory) add ( some object )**  //this adds a slot to the ArrayList (you must add slots before you can set anything)//
 * set ( int slot #, some object )** //after you add a slot, you can assign or set a value or object to the slot (must be done one at a time)//
 * get ( int slot # )**  //returns the called value of a slot//
 * remove( int slot # )** //removes the value or object assigned in a slot//
 * size ** //returns the size of the ArrayList//

Wrapper Classes**

These are classes that we use in the place of primitive data types (instead of int, double, boolean, etc.), because only objects can be used in an ArrayList.

Wrapper Classes: (notice the capital letters!)
 * Integer
 * Boolean
 * Double

Methods: Integer x = new Integer (16); (This is like saying int x = 16;) or... Integer x = 16;


 * Because these are objects, we use the proper object methods (like String methods):

x.equals(10); ...returns true or false; we use this in the place of == x.compareTo(10); ...returns -1 if x < 10, 0 if x = 10, or 1 if x > 10; you DO NOT use <, >, =, etc.

System.out.print(x.intValue); <---returns a 5
 * To find the value of an Integer (Integer x = 5):

For ArrayLists, when doing something like: code format="java5" myMiis.get(2).jump; code temporarily store the Mii: code format="java5" Mii tempMii2 = (Mii) myMiis.get(2); code be sure to cast it (a Mii in this case) otherwise it may not compile. Your finished section of code should look like this: code format="java5" Mii tempMii2 = (Mii) myMiis.get(2); tempMii2.jump;

code