can anyone tell what i'm doing
package com.codegym.task.task05.task0505;
/*
Feline carnage
*/
public class Solution {
public static void main(String[] args) {
Cat cat1 = new Cat("danu",4,45,46);
Cat cat2 = new Cat("gane",5,56,57);
Cat cat3 = new Cat("hone",6,67,68);//write your code here
}
public static class Cat {
protected String name;
protected int age;
protected int weight;
protected int strength;
public Cat(String name, int age, int weight, int strength) {
this.name = name;
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat anotherCat) {
int ageAdvantage = this.age > anotherCat.age ? 1 : 0;
int weightAdvantage = this.weight > anotherCat.weight ? 1 : 0;
int strengthAdvantage = this.strength > anotherCat.strength ? 1 : 0;
int score = ageAdvantage + weightAdvantage + strengthAdvantage;
return score > 2;
if(this.age>anotherCat.age && this.weight>anotherCat.weight && this.strength>anotherCat.strength){
return true;
}
else{
return false;
}// return score > 2 ? true : false;
}
}
}