This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
java:jfc_intf_sort [2021/04/05 06:59] gthanos [Συγκρίνοντας με χρήση ενός Comparator object] |
java:jfc_intf_sort [2021/04/05 06:13] (current) |
||
|---|---|---|---|
| Line 42: | Line 42: | ||
| | | ||
| public boolean equals(Object o) { | public boolean equals(Object o) { | ||
| + | if(o == null) | ||
| + | return false; | ||
| return (o instanceof Student && o.hashCode() == this.hashCode()); | return (o instanceof Student && o.hashCode() == this.hashCode()); | ||
| } | } | ||