Skip to content
Snippets Groups Projects
Select Git revision
  • e9ad417f1f5abcc9eec5390959b2df005cc84dc9
  • master default protected
2 results

res_common.py

Blame
  • Forked from Jean-Marie Place / SCODOC_R6A06
    Source project has a limited visibility.
    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;
            }
    }