public class CompareObjects { public static void main (String []args) { try { Point p = new Point(1,1); Rectangle rect = new Rectangle(10, 20, p); Cuboid cuboid = new Cuboid(rect, 15); System.out.println("Larger objet is "+ MyComparableUtil.findLarger(rect, cuboid)); } catch(InvalidComparableTypeException ex) { System.err.println("Unable to compare objects!"); } } }