Не до конца понимаю, как именно нужно реализовать этот метод и что именно нужно сделать. Подскажите, пожалуйста, что не так? Что нужно, чтобы понять и осознать все ))
package en.javarush.task.jdk13.task05.task0501;
/*
Cat carnage (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);
}
public static class Cat {
private String name;
private int age;
private int weight;
private int strength;
public boolean fight(Cat cat){
int a = 0;
int b = 0;
if (this.age > cat.age) {
a += a;
} else {
b += b;
}
if (this.weight > cat.weight) {
a += a;
} else {
b += b;
}
if ( this.strength > cat.strength) {
a += a;
} else {
b += b;
}
if (a > b) {
return true;
} else if (a < b) {
return false;
} else {
return false;
}
}
public Cat(String name, int age, int weight, int strength) {
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
}
}