Select Git revision
res_common.py
Forked from
Jean-Marie Place / SCODOC_R6A06
Source project has a limited visibility.
-
Emmanuel Viennet authoredEmmanuel Viennet authored
Person.java 1.00 KiB
package tp04;
public class Person {
private static int ID;
private String forename;
private String name;
public Person(String forename, String name){
this.name=name;
this.forename=forename;
}
public int getID(){
return this.ID;
}
public String toString(){
return "(" + this.ID + ":" + this.forename + this.name + ")";
}
public boolean equals(Object ID){
if (this == ID) return true;
if(ID == null) return false;
if(this.getClass() != ID.getClass()) return false;
Person other = (Person) ID;
if(this.name == null) {
if (other.name != null) return false;
} else if (!this.name.equals(other.name)) return false;
if (this.forename == null){
if (other.forename != null) return false;
} else if (!this.forename.equals(other.forename)) return false;
return true;
}
}