Что не так с моим вариантом решения?
package com.javarush.task.jdk13.task05.task0501;
public class Solution {
public static class Cat {
private String name;
private int age;
private int weight;
private int strength;
public Cat(String name, int age, int weight, int strength){
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat cat){
int i = 0;
if (this.age > cat.age) i++;
if (this.weight > cat.weight) i++;
if (this.strength > cat.strength) i++;
return (i > 1 ? true : false);
}
}
public static void main(String[] args) {
Cat barsik = new Cat("Барсик", 1, 5, 12);
Cat stepa = new Cat("Степа", 1, 5, 12);
Cat tuzik = new Cat("Тузик", 1, 5, 12);
}
}