Вроде все правильно, а ошибка есть
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 myCat = 0;
int anCat = 0;
if(this.age <= anotherCat.age){
anCat++;
} else {
myCat++;
}
if(this.strength <= anotherCat.strength) {
anCat++;
} else {
myCat++;
}
if(this.weight <= anotherCat.weight){
anCat++;
} else {
myCat++;
}
if(anCat >= myCat){
return false;
} else {
return true;
}
//напишите тут ваш код
}
public static void main(String[] args) {
}
}