Почему не проходит? Условие вроде выполняется, проверял с разными параметрами.
package com.javarush.task.jdk13.task05.task0501;
/*
Кошачья бойня(1)
*/
public class Solution {
public static class Cat {
private String name;
private int age;
private int weight;
private int strength;
public boolean fight(Cat cat){
int count=0;
count+= this.age-cat.age;
count+= this.weight-cat.weight;
count+= this.strength-cat.strength;
return count>0;
}
public Cat(String name, int age,int weight,int strength){
this.name=name;
this.age=age;
this.weight= weight;
this.strength=strength;
}
}
public static void main(String[] args) {
Cat Vaska= new Cat("Vaska",5,8,35);
Cat Murzik= new Cat("Murzik",6,7,22);
Cat Barsik= new Cat("Barsik",11,11,29);
}
}