Welcome to Westonci.ca, the place where your questions are answered by a community of knowledgeable contributors. Get the answers you need quickly and accurately from a dedicated community of experts on our Q&A platform. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.
Sagot :
Answer:
C. leagueName=newPlayers.getLeague(); getLeague() is not a member of Players.
Explanation:
The main method in this code will case an error when trying to run the following line of code...
leagueName=newPlayers.getLeague();
This is because the method getLeague() is being called on a Player object which takes all of its methods from the Player class. Since getLeague() is not a method located in the player class then it cannot be called by an object from that class. Especially since the Player class does not extend to the SoccerPlayers class where the getLeague() method is actually located. Instead, it is the SoccerPlayers class which extends the Players class as its parent class.
We appreciate your time. Please come back anytime for the latest information and answers to your questions. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Thank you for visiting Westonci.ca, your go-to source for reliable answers. Come back soon for more expert insights.