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: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:30, aryal191
Primary tech skills are skills that are necessary for success in online education
Answers: 3
image
Computers and Technology, 23.06.2019 11:00, jaygamer37
What is the name of the sound effect that danny hears
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, small77
Font size, font style, and are all aspects of character formatting.
Answers: 2
image
Computers and Technology, 23.06.2019 21:00, webbjalia04
Uget brainliest if accurate mary has been given the responsibility of hiring a person for the position of a software testing officer. which management function would mary achieve this responsibility?
Answers: 1
You know the right answer?
Create an interface called Runner. The interface has an abstract method called run() that displays a...

Questions in other subjects:

Konu
Advanced Placement (AP), 03.09.2020 03:01