Java Package

© examsiri.com
Question : 7 of 16
 
Marks: +1, -0
Given:
1. public class Person {
2.   private String name;
3.   public Person(String name) {
4.    this.name = name;
5.   }
6.   public boolean equals(Object o) {
7.    if ( ! o instanceof Person ) return false;
8.    Person p = (Person) o;
9.    return p.name.equals(this.name);
10.   }
11. }

Which statement is true?
Go to Question: