Hi, I have a program that finds out if people are "compatible". The problem I have is that Java seems to be blatantly telling me that 130-130 is greater than 25
public boolean checkMatch(Female other){
if (this.getA()<26&&other.getA()-this.getA()>1){
return false;
}else if(this.getH()-other.getH()>25||this.getH()-other.getH()<-25){
return false;
}else if(this.getP().equals(other.getP())&&this.getS().equals(other.getS())&&this.getD().equals(other.getD())){
return true;
}else{
return false;
}
}
Its supposed to return false if the heights (H) are greater than 25 in difference. But if I enter the heights to be 130 and 130 respectively for example, that part of the method will still return false. I am sure that its the height that's setting it off as I tested it with a method that just checks the "height compatibility". What's going on here?
Thanks.