Как сравнивать показатели котов? почему нужен this age? параметр какого кота он имеет ввиду?
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 anotherCat = 0;
if (this.age > anotherCat.age) {
anotherCat++;}
else if (anotherCat.age > this.age) {
x++;}
}
public static void main(String[] args) {
}
}