подскажите, пожалуйста, где ошибка: не реализован механизм драки котов в зависимости от их веса, возраста и силы согласно условию.
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 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) {
boolean a = (this.age > anotherCat.age);
boolean b = (this.weight > anotherCat.weight);
boolean c = (this.strength > anotherCat.strength);
boolean weAreWinners;
if (a & b || a & c || b & c) {
weAreWinners = true;
} else
weAreWinners = false;
return weAreWinners;
}
}
public static void main(String[] args) {
Cat catOne = new Cat("Tom", 2, 3, 5);
Cat catTwo = new Cat("Barsik", 3, 3, 7);
Cat catThree = new Cat("Punja", 5, 3, 4);
}
}