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