Она же выводится после драки котов, я её пишу чтобы вывелась а мне говорят импортировать её. Она же задана как int score, почему описания нет?
package com.javarush.task.task05.task0505;
/*
Кошачья бойня
*/
public class Solution {
public static void main(String[] args) {
//напишите тут ваш код
Cat cat1 = new Cat("Шизик", 4, 10, 15);
Cat cat2 = new Cat("Тузик", 2, 8, 12);
Cat cat3 = new Cat("Мурзик", 5, 9, 16);
cat1.fight(cat2);
System.out.println(score);
cat1.fight(cat3);
System.out.println(score);
cat2.fight(cat3);
System.out.println(score);
}
public static class Cat {
protected String name;
protected int age;
protected int weight;
protected int strength;
public Cat(String name, int age, int weight, int strength) {
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat anotherCat) {
int ageScore = Integer.compare(this.age, anotherCat.age);
int weightScore = Integer.compare(this.weight, anotherCat.weight);
int strengthScore = Integer.compare(this.strength, anotherCat.strength);
int score = ageScore + weightScore + strengthScore;
return score > 0; // return score > 0 ? true : false;
}
}
}