Или тут нужно прям отдельно каждый сравнивать параметр?
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 sum1 = this.age + this.weight + this.strength;
int sum2 = anotherCat.age + anotherCat.strength +anotherCat.weight;
int score = sum1 - sum2;
if (score == 0){
return true;
}
else if (score > 0){
return true;
}
else {
return false;
}
}
public static void main(String[] args) {
}
}