Подскажите, пожалуйста, что делаю не так? не проходит 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 (this.age > anotherCat.age)
a++;
else
a--;
if (this.weight > anotherCat.weight)
a++;
else
a--;
if (this.strength > anotherCat.strength)
a++;
else
a--;
if (a > 1)
return true;
else
return false;
}
public static void main(String[] args) {
Cat cat_1 = new Cat();
cat_1.age = 5;
cat_1.weight = 6;
cat_1.strength = 7;
Cat cat_2 = new Cat();
cat_2.age = 4;
cat_2.weight = 5;
cat_2.strength = 6;
System.out.println(cat_1.fight(cat_2));
System.out.println(cat_2.fight(cat_1));
}
}