Помогите, пожалуйста! Пишет, что я не указал return в 35 строке... Зачем он там?
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 i = 0;
int a = 0;
if (this.age>anotherCat.age)
i++;
else if (this.age<anotherCat.age)
a++;
if (this.weight>anotherCat.weight)
i++;
else if (this.weight<anotherCat.weight)
a++;
if (this.strength>anotherCat.strength)
i++;
else if (this.strength<anotherCat.strength)
a++;
if (i>a)
return true;
else if (a>=i)
return false;
//напишите тут ваш код
}
public static void main(String[] args) {
Cat cat1 = new Cat();
cat1.age = 1;
cat1.weight = 3;
cat1.strength = 4;
Cat cat = new Cat();
cat.age = 3;
cat.weight = 2;
cat.strength = 4;
System.out.println(cat1.fight(cat));
}
}