Что не так???))
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 anCat) {
int res = 0;
//напишите тут ваш код
if (this.age > anCat.age) res++ ;
else res-- ;
if (this.weight > anCat.weight) res++;
else res--;
if (this.strength > anCat.strength) res++;
else res--;
if (res>0)
return(true);
else return(false);
}
public static void main(String[] args) {
Cat first = new Cat();
first.age = 10;
first.weight= 10;
first.strength= 10;
Cat second = new Cat();
second.age = 5;
second.weight= 10;
second.strength= 5;
first.fight(second);
}
}