Computers and Technology
Computers and Technology, 04.03.2021 20:40, isbella29

Which statement in main() generates an error? public class Players {
public void setName(String newName) { … }
public void setAge(int newAge) { … }
};
public class SoccerPlayers extends Players {
public void setDetails(String newName) { … }
public String getLeague() { … }
};
public static void main(String args[]) {
String leagueName;
Players newPlayers = new Players();
SoccerPlayers playerObject = new SoccerPlayers();
playerObject. setName("Jessica Smith");
playerObject. setAge(21);
leagueName = newPlayers. getLeague(); }
A. SoccerPlayers playerObject=new SoccerPlayers(); An object of a derived class cannot be created.
B. playerObject. setName("Jessica Smith"); setName() is not declared in SoccerPlayers.
C. leagueName=newPlayers. getLeague(); getLeague() is not a member of Players.
D. Players newPlayers=new Players(); An object of a base class cannot be created.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:30, silasjob09
Jenny wants to look at row 345 and compare it to row 17. what can she do if she wanted to easily adjust to see both at once?
Answers: 3
image
Computers and Technology, 22.06.2019 22:30, jacob7542
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
image
Computers and Technology, 23.06.2019 00:30, devenybates
Which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
image
Computers and Technology, 24.06.2019 10:00, shrafe
Which two technologies support the building of single-page applications?
Answers: 2
Do you know the correct answer?
Which statement in main() generates an error? public class Players {
public void setName(Str...

Questions in other subjects:

Konu
Mathematics, 17.12.2020 01:10