Question: 1 : public boolean equals ( Object o ) 2 : { 3 : if ( o = = this ) return true; 4 :

1: public boolean equals(Object o)
2: {
3: if (o == this) return true;
4: else if (!(o instanceof Person))
5: return false;
6: else {
7: Person p =(Person) o;
8:
9: if (!name.equals(p.getName()) return false;
10: else return true;
11: }
12: }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!