/** * Author: Josiah Yoder et al. * Class: SE1021-031 * Date: 12/17/13 11:42 AM * Lesson: Week 3, Day 1 */ package example3_1; /** * Illustrates the need & technique for extending * equals() */ public class Example { public static void main(String[] ignored) { Drawable c1 = new Circle(0,0,1.0); Drawable c2 = new Circle(0,0,1.0); // Without implementing equals ourself, // this returns false. // Once we implement equals, // it returns the expected value System.out.println(c1.equals(c2)); // This always returns false because // c1 and c2 are different objects, // so the reference point to different // places. System.out.println(c1 == c2); } }