Где ошибка?
package com.javarush.task.task05.task0502;
/*
Реализовать метод fight
*/
public class Cat {
public int age;
public int weight;
public int strength;
int count = 0;
public Cat() {
}
public boolean fight(Cat anotherCat) {
if(this.age > anotherCat.age) {
count++;
}
if(this.weight > anotherCat.weight) {
count++;
}
if(this.strength > anotherCat.strength) {
count++;
}
if(count > 1) {
return true;
} else {
return false;
}
}
public static void main(String[] args) {
Cat cat1 = new Cat();
Cat1.age = 5;
Car2.age = 10;
Cat1.weight = 7;
Cat cat2 = new Cat();
Cat2.weight = 8;
Cat1.strength = 10;
Cat2.strength = 5;
System.out.println(cat1.fight(cat2));
System.out.println(cat2.fight(cat1));
}
}