ArrayList practice
- Create an ArrayList of integers.
- Put 15 numbers into the ArrayList, where index n contains the number n2.
- Print out the contents of the ArrayList. (How is this different from printing out the contents of an array?
- Add one to each number in the ArrayList.
- Print the ArrayList again to make sure that worked.
- Write a method sum that returns the sum of elements in an ArrayList of integers.
- Print the sum of the integers in the ArrayList
- Write a method that deletes all odd numbers in an ArrayList of integers.
- Print out the ArrayList.
- Print out its sum