Guest User

Untitled

a guest
Jul 12th, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. @Override
  2. public boolean equals(Object r) {
  3. if(this == r) {
  4. return true;
  5. }
  6. if (null == r) {
  7. return false;
  8. }
  9. if (!(r instanceof RatNum)) {
  10. return false;
  11. } else {
  12. RatNum r2 = (RatNum) r;
  13. if (this.num == r2.num && this.den == r2.den) {
  14. return true;
  15. } else {
  16. return false;
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment