You are getting those issues because Fighter doesn't have the proper methods. For example: Fighter has a constructor defined as public Fighter (int num1, int num2, int num3, String str)
, but you are trying to instantiate a new one with enemyFighter = new Fighter( );
. You will need to create another constructor (overload the existing one) that takes no parameters.
The same thing happens with the attack method, it's signature is public void attack()
but you are calling it with some parameters: myFighter.attack (enemyFighter);
. That means you'll need an overloaded attack method that receives one parameter of type Fighter: public void attack(Fighter fighter)