Чего еще не хватает
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 n1 = 0;
int n2 = 3;
if(this.age==anotherCat.age || this.strength==anotherCat.strength || this.weight==anotherCat.weight){
n1+=0;
n2+=0;
}
if(this.age>anotherCat.age && this.age!=anotherCat.age){
n1++;
}else
n2--;
if(this.strength>anotherCat.strength && this.strength!=anotherCat.strength){
n1++;
}else
n2--;
if(this.weight>anotherCat.weight && this.weight!=anotherCat.weight){
n1++;
}else
n2--;
if(n1>n2 || n1==n2){
return true;
}else
return false;
}
public static void main(String[] args) {
Cat cat1 = new Cat();
Cat cat2 = new Cat();
System.out.println(cat1.fight(cat2));
System.out.println(cat2.fight(cat1));
}
}