Hey guys,
having trouble. I don't know what code is expected From me.
I don't even know where we have learnt how objects interact. Could you give me some good book/video references? I googled it, but the results were really introductory to objects and classes, without getting to the meat.
package com.codegym.task.task05.task0502;
/*
Implement the fight method
*/
public class Cat {
public int age;
public int weight;
public int strength;
public Cat(int age, int weight, int strength)
{
this.age = age;
this.weight = weight;
this.strength = strength;
}
public boolean fight(Cat anotherCat) {
//write your code here
if ((this.strength+this.weight-this.age)>(anotherCat.strength-anotherCat.age+anotherCat.weight)){return true;} else {return false;}
}
public static void main(String[] args) {
Cat meowzi = new Cat(3, 6, 10);
Cat snobilicat = new Cat(5, 12, 20);
}
}