Валидатор ругается, хотя программа отрабатывает корректно
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int weight;
public int age;
public int strength;
// public Cat(int age, int weight, int strength) {
// this.age = age;
// this.weight = weight;
// this.strength = strength;
//
// }
public int[] getArray() {
return new int[]{weight, age, strength};
}
public Cat() {
}
public boolean fight(Cat anotherCat) {
int counter = 0;
int[] array1 = this.getArray(), array2 = anotherCat.getArray();
for (int i = 0; i < 3; i ++ ) {
if (array1[i] > array2[i]) counter++;
else if (array1[i] < array2[i]) counter--;
}
return counter > 0;
}
public static void main(String[] args) {
// Cat cat1 = new Cat(7, 6, 4);
// Cat cat2 = new Cat(30,200,3);
// System.out.println(cat1.fight(cat2));
}
}