Почему не пропускает? что нужно добавить или убрать? Заранее спасибо
P.S. не обращайте внимания на комментарии)
package com.javarush.task.jdk13.task05.task0501;
/*
Кошачья бойня(1)
*/
public class Solution {
public static class Cat {
private String name;
private int age;
private int weight;
private int strength;
public Cat(String name, int age, int weight, int strength){
this.setName(name);
this.setAge(age);
this.setWeight(weight);
this.setStrength(strength);}
public void setName(String name){
this.name = name;}
public String getName(){
return name;}
public void setAge(int age){
this.age = age;}
public int getAge(){
return age;}
public void setWeight(int weight){
this.weight = weight;}
public int getWeight(){
return weight;}
public void setStrength(int strength){
this.strength = strength;}
public int getStrength(){
return strength;}
public boolean fight(Cat anotherCat){
int pointFirstCat = 0;
int pointSecondCat = 0;
if(age <= anotherCat.age){
pointSecondCat++;}
else{
pointFirstCat++;}
if(weight <= anotherCat.weight){
pointSecondCat++;}
else{pointFirstCat++;}
if(strength <= anotherCat.strength){
pointSecondCat++;}
else {pointFirstCat++;}
if(pointSecondCat >= pointFirstCat){
return false;} else { return true;}
}
public static void main(String[] args) {
Cat vaska = new Cat("Васька", 2, 1, 1); // 3 место
Cat murzik = new Cat("Мурзик", 1, 1, 1); // 2 место
Cat barsik = new Cat("Барсик", 4, 24, 8); //1 место
vaska.fight(murzik);
}
}
}