Прошелся по всем вариантам, ошибки вроде нет, а все равно ругается.
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
//параметры кота (возраст, вес, сила)
public int age;
public int weight;
public int strength;
//очки в драке котов
private static int count1 = 0;
private static int count2 = 0;
//пустой конструктор
public Cat() {
}
//метод драки котов
public boolean fight(Cat anotherCat) {
if (this.age > anotherCat.age){
count1++;
} else if (this.age == anotherCat.age){
count1++;
count2++;
} else count2++;
if (this.weight > anotherCat.weight){
count1++;
} else if (this.weight == anotherCat.weight){
count1++;
count2++;
} else count2++;
if (this.strength > anotherCat.strength){
count1++;
} else if (this.strength == anotherCat.strength){
count1++;
count2++;
} else count2++;
if (count1 == count2){
return true;
} else return count1 > count2;
}
public static void main(String[] args) {
}
}