subject

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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 18:20
Acommon algorithm for converting a decimal number to binary is to repeatedly divide the decimal number by 2 and save the remainder. this division is continued until the result is zero. then, each of the remainders that have been saved are used to construct the binary number.write a recursive java method that implements this algorithm.it will accept a value of int and return a string with the appropriate binary character representation of the decimal number.my code: public class lab16{public string converttobinary(int input){int a; if(input > 0){a = input % 2; return (converttobinary(input / 2) + "" +a); } return ""; } }
Answers: 1
question
Computers and Technology, 25.06.2019 07:00
Quick styles allow you to format an entire document quickly? t/f
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
Java and c++ are examples of languagehigh-level languagesmachine languagecompiler languages
Answers: 1
question
Computers and Technology, 25.06.2019 17:40
4) wilkes continues to discuss the concept of time and how it relates to the type of photography he does. why do you feel that the concept of time is of suck importance to him as a photographer? 5) unit 10 explores photographs with movement in them such as wildlife and documentary photography. wilkes takes the idea of movement in photography to a different level. do you feel the tips and information that you have learned in unit 10 is applicable to the type of photography that wilkes does? answer as soon as possible im so confused
Answers: 1
You know the right answer?
Which statement in main() generates an error? public class Players {
public void setName(Str...
Questions
question
Geography, 23.08.2019 17:00
question
Biology, 23.08.2019 17:00
Questions on the website: 13722361