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, 22.06.2019 16:30
The most common battery cable terminal is a that provides a large surface contact area with the ability to tighten the terminal onto the battery post using a nut and bolt.
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 25.06.2019 01:20
Jason typically uses the internet to buy various items. it the total cost of all of the items ordered, at one time, is $250 or more, then the shipping and handling is free, otherwise the shipping and handling is $15 per item. design an algorithm that prompts jason to enter the number of items ordered and the price of each item. (remember cost = number of items order times price) the algorithm then outputs the total billing amount including shipping and handling. your algorithm must use a loop (repetition structure) to get the number and price of each item. write this in algorithm format not program code format.
Answers: 2
You know the right answer?
Which statement in main() generates an error? public class Players {
public void setName(Str...
Questions
question
Mathematics, 02.04.2021 03:50
question
Mathematics, 02.04.2021 03:50
question
Mathematics, 02.04.2021 03:50
question
Computers and Technology, 02.04.2021 03:50
Questions on the website: 13722360