Подскажите, почему не проходит проверку?
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) {
//напишите тут ваш код
boolean fightResult = true;
int catParameters = 0;
if (this.age > anotherCat.age)
catParameters++;
if (this.weight > anotherCat.weight)
catParameters++;
if (this.strength > anotherCat.strength)
catParameters++;
if(catParameters < 2)
fightResult = false;
return fightResult;
}
public static void main(String[] args) {
}
}