Подскажите пожалуйста,что не так с задачей.
package com.javarush.task.jdk13.task05.task0501;
/*
Кошачья бойня(2)
*/
public class Solution {
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);
cat1.figth(cat2);
}
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 figth(Cat anotherCat){
int a= Integer.compare(this.age,anotherCat.age);
int b= Integer.compare(anotherCat.age,this.age);
int a1= Integer.compare(this.weight,anotherCat.weight);
int b1= Integer.compare(anotherCat.weight,this.weight);
int a2= Integer.compare(this.strength,anotherCat.strength);
int b2= Integer.compare(anotherCat.strength,this.strength);
int c= a+a1+a2;
int d= b+b1+b2;
if (c>=2||d>=2) {
return true;
} else{
return false;
}
}
}
}