HELP
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 s1 = 0;
int s2 = 0;
if (this.age > anotherCat.age) {
s1++;
} else {
s2++;
}
if (this.strength > anotherCat.strength) {
s1++;
} else {
s2++;
}
if (this.weight > anotherCat.weight) {
s1++;
} else {
s2++;
}
if (s1 == s2) {
return false;
}
else if (s1 > s2) {
return true;
}
else if (s1 < s2) {
return false;
}
return s1 > s2 ;
}
public static void main(String[] args) {
}
}