Код не проходит по условию "Если ничья, то метод факт должен возвращать фолс". Где ошибка в коде?? Туплю и не вижу
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat() {
}
public boolean fight(Cat anotherCat) {
int thisCat = 0;
int anCat = 0;
if (this.age >= anotherCat.age){
if (this.age >= anotherCat.age){
thisCat++;
}
}
else {
anCat++;
}
if (this.weight >= anotherCat.weight){
if (this.weight > anotherCat.weight){
thisCat++;
}
}
else{
anCat++;
}
if (this.strength >= anotherCat.strength){
if (this.strength > anotherCat.strength){
thisCat++;
}
}
else{
anCat++;
}
if (thisCat > anCat){
return true;
}
if (thisCat == anCat)
return false;
else
return false;
}
public static void main(String[] args) {
}
}