Name: 
ArrayLists
Answer the following questions:
1. Say that you want a list of int values. But an ArrayList can contain only object references. How can you use an ArrayList to store your ints? 

2. Examine the following:
	ArrayList<Integer> values = new ArrayList<Integer>();
What type of data will values hold?

3. Suppose that the following follows the first three add statements:
		names.add("Daniel");
(a) Where will the reference to "Daniel" be added? Which cell index?

(b) Except for data types, what is the only restriction when adding items to an ArrayList?

4. What is the size of the ArrayList in the picture?

5. Here is a declaration and construction of a ArrayList:
		ArrayList<String> data = new ArrayList<String>(10);
	Which of the following statements will work? If not, why not?
(a) data.add("Irene Adler"); 

(b) data.add(new String("Laura Lyons")); 

(c) data.add(221); 

(d) data.add(new Integer(221));

6. What is the index of the first cell of a list?

7. What does null mean in an ArrayList? How is this different to what it means in an array?

8. Try to remove a specific name. 
Write ‘commented out’ code which might produce a ‘ConcurrentModificationException’ and explain.

Also write code which will compile and never produce a 	‘ConcurrentModificationException’ .