Hey, I did some searching on this problem and nothing I tried fixed it so here goes:
I am working with inheritance for the first time. Trying to write a program with a parent class that has a child class that is also a parent class to a third class. Parent is called Player, child: ComputerPlayer, and child of that: NaiveComputerPlayer. I am getting an error in my ComputerPlayer class saying that the super constructor is undefined for the Player() class. Here is my code for the parent class:
and here is the code for the child class, ComputerPlayer:
As you can see, I tried to include a default constructor in Player with no parameters, which the sites I found recommended for my problem, but the error persists in the ComputerPlayer class. Can anyone tell me what I am missing? Just in point of fact, I am only using ComputerPlayer as a platform to extend Player to the types of computer player bots I am writing, which is why there is nothing but a constructor there, which, again, is what I thought I needed to use inheritance for the respective child classes. As always, I really appreciate any help you might offer.
I am working with inheritance for the first time. Trying to write a program with a parent class that has a child class that is also a parent class to a third class. Parent is called Player, child: ComputerPlayer, and child of that: NaiveComputerPlayer. I am getting an error in my ComputerPlayer class saying that the super constructor is undefined for the Player() class. Here is my code for the parent class:
and here is the code for the child class, ComputerPlayer:
As you can see, I tried to include a default constructor in Player with no parameters, which the sites I found recommended for my problem, but the error persists in the ComputerPlayer class. Can anyone tell me what I am missing? Just in point of fact, I am only using ComputerPlayer as a platform to extend Player to the types of computer player bots I am writing, which is why there is nothing but a constructor there, which, again, is what I thought I needed to use inheritance for the respective child classes. As always, I really appreciate any help you might offer.