ΠΠΎΡ ΡΠ°ΠΊΠΎΠΉ ΠΊΠΎΠ΄. ΠΡΠΎΠ²Π΅ΡΡΠ» Ρ ΡΠ°Π·Π½ΡΠΌΠΈ Π·Π½Π°ΡΠ΅Π½ΠΈΡΠΌΠΈ, ΠΊΡΡΡΠΈΠ» ΠΈ Π½Π°ΠΏΡΠ°Π²ΠΎ ΠΈ Π½Π°Π»Π΅Π²ΠΎ ΠΊΠΎΡΠΎΠ². Π‘ΡΠ°Π²ΠΈΠ» ΠΎΠ΄ΠΈΠ½Π°ΠΊΠΎΠ²ΡΠ΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΡ, Π²ΡΠ΅, Π΅ΡΠ΅ ΡΠ°Π·, ΠΠ‘Π ΡΡΠ»ΠΎΠ²ΠΈΡ Π²ΡΠΏΠΎΠ»Π½Π΅Π½Ρ. ΠΠ½Π΅ ΠΏΠΈΡΡΡ: Π‘ΡΠ°Π²Π½ΠΈ ΠΊΠ°ΠΆΠ΄ΡΠΉ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡ ΠΏΠΎ ΠΎΡΠ΄Π΅Π»ΡΠ½ΠΎΡΡΠΈ ΠΈ Ρ ΠΊΠΎΠ³ΠΎ Π±ΠΎΠ»ΡΡΠ΅ ΠΏΠΎΠ±Π΅Π΄ΠΈΠ²ΡΠΈΡ
, ΡΠΎΡ Π²ΡΠΈΠ³ΡΠ°Π». Π Π² ΡΠ΅ΠΌ ΠΏΡΠΈΠΊΠΎΠ».?
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 count = 0;
if (this.age > anotherCat.age)
count++;
if (this.weight > anotherCat.weight)
count++;
if (this.strength > anotherCat.strength)
count++;
return count > 1;//Π½Π°ΠΏΠΈΡΠΈΡΠ΅ ΡΡΡ Π²Π°Ρ ΠΊΠΎΠ΄
}
public static void main(String[] args) {
}
}