Modify the SodaCan class of Exercise P8.5 to implement the Measurable interface. The measure of a soda can should be its surface area. Write a program that computes the average surface area of an array of soda cans.
A person has a name and a height in centimeters. Use the average method in Section 9.6 to process a collection of Person objects.
Write a method
public static Measurable maximum(Measurable[] objects)
that returns the object with the largest measure. Use that method to determine the country with the largest area from an array of countries.
Declare an interface Filter as follows: public interface Filter
{
boolean accept(Object x);
}
Write a method
public static ArrayList