Write a method that takes an ArrayList
of Integer and returns the int sum of the
numbers in the list.
Write a method that takes an ArrayList of String
values and returns the int count of the numbers of
occurrences of "pig" in the list.
Write a void method that takes an ArrayList
of String values replaces all the occurrences
of "cat" with "dog".
Write a void method that takes an ArrayList
of String values remove all the occurrences
of "frog".
Write a method that takes an ArrayList of String
and counts how many times "egg" immediately
precedes "chicken" and how many times "chicken"
immediately precedes "egg" and returns "egg" if
egg comes first more often; "chicken" if chicken comes first
more often; and "Nobody knows!" if they are tied.
A few ArrayList methods to practice with.