Хелп плиаз. Нивазаможна!
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 i=0;
if (this.age<anotherCat.age) ++i;
if (this.weight<anotherCat.weight) ++i;
if (this.strength<anotherCat.strength) ++i;
int c=0;
if (this.age>anotherCat.age) ++c;
if (this.weight>anotherCat.weight) ++c;
if (this.strength>anotherCat.strength) ++c;
return (i>c);
}
public static void main(String[] args) {
}
}