и я не до конца понимаю логику, метод boolean должен возвращать false или true, но как реализовать этот код после всех if-ов я не знаю (
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 score1=0;
int score2=0;
if(this.age>anotherCat.age) {
score1++;
return true;
}
if (this.weight>anotherCat.weight) {
score1++;
return true;
}
if(this.strength>anotherCat.strength) {
score1++;
return true;
}
if(this.age<anotherCat.age) {
score2++;
return false;
}
if (this.weight<anotherCat.weight) {
score2++;
return false;
}
if(this.strength<anotherCat.strength) {
score2++;
return false;
}
else if(score1>=score2) {
}
return true;
}
public static void main(String[] args) {
}
}