Вроде все условия соблюдены, что я только не делал, но по пункту 4 не проходит. Тыкните носом, где я не прав
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 a=0;
if (weight>anotherCat.weight)
a++;
else
a--;
if (age>anotherCat.age)
a++;
else
a--;
if (strength>anotherCat.strength)
a++;
else
a--;
return a>0;
}
public static void main(String[] args) {
Cat cat1=new Cat();
cat1.strength=10;
cat1.weight=20;
cat1.age=15;
Cat cat2=new Cat();
cat2.weight=20;
cat2.strength=25;
cat2.age=20;
System.out.println(cat1.fight(cat2));
}
}