java:jfc_interfaces

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
java:jfc_interfaces [2016/02/26 11:15]
127.0.0.1 external edit
java:jfc_interfaces [2017/05/12 12:28]
gthanos
Line 51: Line 51:
   public int getId() {   public int getId() {
     return id;     return id;
 +  }
 +  ​
 +  public boolean equals(Object obj) {
 +    if(!obj.instanceof Student )
 +      return false;
 +    Student st = (Student)obj;​
 +    if( id == id && firstName.equals(st.firstName) && lastName.equals(st.lastName) )
 +      return true;
 +    return false;
   }   }
   ​   ​
java/jfc_interfaces.txt · Last modified: 2017/05/12 13:20 by gthanos