как мне правильно оформить в методе возвращение правды или лжи? что ни так?
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat(int age,int weight,int strength) {
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat anotherCat) {
//напишите тут ваш код
int x = 0;
int anCat = 0;
if (this.age > anotherCat.age) {
x++;}
else if (anotherCat.age > this.age) {
anCat++;}
else if (anotherCat.weight > this.weight) {
anCat++;}
else if (this.weight > anotherCat.weight) {
x++;}
else if (anotherCat.strength > this.strength) {
anCat++;}
else if (this.strength > anotherCat.strength) {
x++;}
if (anCat > x) {
return true;}
else if (x > anCat) {
return false;}
else if (x == anCat) {
return false;}
}
public static void main(String[] args) {
}
}