AleksandarArkan

j - equals

Sep 3rd, 2015
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. public boolean equals(Object oggetto){
  2.          if (oggetto==null){
  3.              return false;
  4.          }
  5.          if(this.getClass()!=oggetto.getClass()){
  6.              return false;
  7.          }
  8.          Razionale convertito = (Razionale) oggetto;
  9.          return (this.numeratore==convertito.numeratore && this.denominatore==convertito.denominatore);
  10.     }
Advertisement
Add Comment
Please, Sign In to add comment