Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean equals(Object other) {
- if (other == Polynom.NaP || this == Polynom.NaP ){
- return false;
- }
- boolean eq = false;
- if (other instanceof Polynom){ // hier könnte man auch this.getClass() == other.getClass()
- if ((other) != null && this != null){
- if (((MapPolynom)other).degree() == this.degree()){
- int i = (int)this.degree();
- while (i>=0){
- if ( this.coeff(i) == ((MapPolynom)other).coeff(i)){
- eq = true;
- i--;
- }else{
- eq = false;
- break;
- }
- }
- }
- }
- }
- return eq;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement