Question: Which statement generates an error? Why? class Player { public: void SetName ( string newName ) { . . . } void SetAge ( int

Which statement generates an error? Why?
class Player { public: void SetName(string newName){...} void SetAge(int newAge){...}}; class SoccerPlayer: public Player { public: void SetDetails(string newName){...} string GetLeague(){...}}; int main(){ String leagueName; Player newPlayer; SoccerPlayer newSoccerPlayer; newSoccerPlayer.SetName("Tim Murphy"); newSoccerPlayer.SetAge(21); leagueName = newPlayer.GetLeague(); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!