The output is fine, but still it doesn't pass verification...
package pl.codegym.task.task05.task0502;
/*
Zaimplementuj metodę walka
*/
public class Kot {
public int wiek;
public int waga;
public int sila;
public static Kot kot1 = new Kot();
public static Kot kot2 = new Kot();
public Kot() {
}
public boolean walka(Kot innyKot) {
this.wiek=1; this.waga=10; this.sila=10; innyKot.wiek=5; innyKot.waga=2; innyKot.sila=7;
if (this ==kot1 && this.wiek<innyKot.wiek &&this.waga>innyKot.waga&&this.sila>innyKot.sila)
{
return true;
}
else
return false;
}
public static void main(String[] args) {
System.out.print(kot2.walka(kot1));
}
}