Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean equals(Object r) {
- if(this == r) {
- return true;
- }
- if (null == r) {
- return false;
- }
- if (!(r instanceof RatNum)) {
- return false;
- } else {
- RatNum r2 = (RatNum) r;
- if (this.num == r2.num && this.den == r2.den) {
- return true;
- } else {
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment