Я хоть в верном направлении двигаюсь?
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;
int[] setCat1 = {this.age, this.weight, this.strength};
int[] setCat2 = {anotherCat.age, anotherCat.weight, anotherCat.strength};
for (int i= 0; i < setCat1.length; i++) {
if (setCat1[i] >= setCat2[i]) {
score1++;
}
else {
score2++;
}
}
return score1 >= score2;
}
public static void main(String[] args) {
}
}