Advertisement
Alsturm

Untitled

Jul 2nd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package t01;
  2.  
  3. import java.math.BigDecimal;
  4.  
  5. public class Eraser extends OfficeSupply {
  6.     public Eraser(String name, BigDecimal price) {
  7.         super(name, price);
  8.     }
  9.  
  10.     public boolean equals(Object o) {
  11.         if (o == this) return true;
  12.         if (!(o instanceof Eraser)) return false;
  13.         final Eraser other = (Eraser) o;
  14.         if (!other.canEqual((Object) this)) return false;
  15.         return true;
  16.     }
  17.  
  18.     public int hashCode() {
  19.         int result = 1;
  20.         return result;
  21.     }
  22.  
  23.     protected boolean canEqual(Object other) {
  24.         return other instanceof Eraser;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement