/** Test of MeasureUtil. Note that we could change the * actual classes of elements in the measurables array (as * long as they implemented Measurable) without changing * the rest of the code. * * Taken from Core Web Programming from * Prentice Hall and Sun Microsystems Press, * http://www.corewebprogramming.com/. * © 2001 Marty Hall and Larry Brown; * may be freely used or adapted. */ public class MeasureTest { public static void main(String[] args) { Measurable[] measurables = { new Rectangle(0, 0, 5.0, 10.0), new Rectangle(0, 0, 4.0, 9.0), new Circle(0, 0, 4.0), new Circle(0, 0, 5.0) }; System.out.print("Areas:"); for(int i=0; i