как я понимаю, осталось реализовать равенство
но пока не понял как
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 fight =0;
int fighta= 0;
if (this.age > anotherCat.age)
fight++;
if (this.age <anotherCat.age)
fighta++;
if (this.strength >anotherCat.strength)
fight++;
if (this.strength <anotherCat.strength)
fighta++;
if (this.weight >this.weight)
fight++;
if (this.weight <anotherCat.weight)
fighta++;
if (fight <fighta)
return false;
if (fight>fighta)
return true;
else
return false;
}
public static void main(String[] args) {
}
}