Выполняются все условия, кроме 4-го. Помогите пожалуйста разобраться почему.
package com.javarush.task.task05.task0502;
import java.io.*;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat() {
}
public boolean fight(Cat anotherCat) {
int a=0, e=0;
if(this.age>anotherCat.age) a=a+1;
if(anotherCat.age>this.age) e=e+1;
else a=a+1; e=e+1;
if(this.strength>anotherCat.strength) a=a+1;
if(anotherCat.strength>this.strength) e=e+1;
else a=a+1; e=e+1;
if(this.weight>anotherCat.strength) a=a+1;
if(anotherCat.weight>this.weight) e=e+1;
else a=a+1; e=e+1;
boolean i=a>e;
return i;
//напишите тут ваш код
}
public static void main(String[] args) {
Cat cat1 = new Cat();
Cat cat2 = new Cat();
cat1.age=4;
cat1.weight=8;
cat1.strength=9;
cat2.age=4;
cat2.weight=7;
cat2.strength=2;
cat2.fight(cat1);
}
}