subject

Create an interface called Runner. The interface has an abstract method called run() that displays a message describing the meaning of run to the class. Create classes called Machine, Athlete, and PoliticalCandidate that all implement Runner. The run() should print the following in each class:
Machine - When a machine is running, it is operating.
Athlete - An athlete might run in a race, or in a game like soccer.
PoliticalCandidate - A political candidate runs for office.

public class Athlete implements Runner
{
public void run()
{
// write your code here
}
}

public class DemoRunners
{
public static void main(String[] args)
{
Machine runner1 = new Machine();
Athlete runner2 = new Athlete();
PoliticalCandidate runner3 = new PoliticalCandidate();
runner1.run();
runner2.run();
runner3.run();
}
}

public class Machine implements Runner
{
public void run()
{
// write your code here
}
}

public class PoliticalCandidate implements Runner
{
public void run()
{
// write your code here
}
}

public interface Runner
{
// write your code here
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
question
Computers and Technology, 24.06.2019 08:30
@josethesolis i need can anyone text me and follow me
Answers: 1
You know the right answer?
Create an interface called Runner. The interface has an abstract method called run() that displays a...
Questions
question
History, 17.12.2019 16:31
question
Mathematics, 17.12.2019 16:31
question
English, 17.12.2019 16:31
Questions on the website: 13722363