Подскажите, что не так ? :(
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; //1
int count2=0;//0
if (this.age > anotherCat.age) count++;
else if(this.age < anotherCat.age) count2++;
else if(this.age == anotherCat.age){
count++;
count2++;
}
;
if (this.weight > anotherCat.weight) count++;
else if(this.weight < anotherCat.weight) count2++;
else if(this.weight == anotherCat.weight){
count++;
count2++;
}
if (this.strength > anotherCat.weight) count++;
else if(this.strength < anotherCat.strength) count2++;
else if(this.strength == anotherCat.strength){
count++;
count2++;
}
return (count>count2);
}
public static void main(String[] args) {
Cat c1= new Cat();
Cat c2= new Cat();
c1.age=10;
c1.weight=1;
c1.strength=1;
c2.age=1;
c2.weight=1;
c2.strength=1;
}
}