package inheritance;
import java.util.ArrayList;

public class ShapeDemo {
    public static double totalArea( ArrayList<? extends Shape> arr) {
        double total = 0;
        for (Shape s : arr) {
            if (s != null) {
                total += s.area();
            }
        }
        return total;
    }
    
    public static void main(String[] args) {
    }
}
