Hi Sarwar,
you are smart. i got you.
ToDos t1 = new ToDos("Monday"); // "Monday" created in pool
ToDos t2 = new ToDos("Monday"); // "Monday" refers to above in pool
Hence both the keys are equal by definition
public boolean equals(Object o) { return ((ToDos)o).day == this.day; }
If you don't want them to be overwritten try like this
ToDos t1 = new ToDos(new String("Monday"));
ToDos t2 = new ToDos(new String("Monday"));
Hope it clear.
Lets Rock