Привет. Не проходит условие "В методе fight реализовать механизм драки котов в зависимости от их веса, возраста и силы согласно условию." Остальные прошли, не понимаю что не так(
package com.javarush.task.jdk13.task05.task0501;
/*
Кошачья бойня(2)
*/
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 anotherCat) {
int a = 0;
int b = 0;
if (age > anotherCat.age) {
a++;
}
else b++;
if (weight > anotherCat.weight) {
a++;
}
else b++;
if (strength > anotherCat.strength) {
a++;
}
else b++;
if (a > b) {
return true;
}
else return false;
}
}
public static void main(String[] args) {
Cat cat1 = new Cat("Tom", 2, 2, 2);
Cat cat2 = new Cat("Sam", 2, 2, 2);
Cat cat3 = new Cat("Fiona", 3, 3, 3);
cat2.fight(cat1);
}
}