Computers and Technology

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
}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 10:00, zlittleton2008
Which feature of a blog to restore and retrieve older post
Answers: 3
image
Computers and Technology, 24.06.2019 14:00, ratpizza
Which describes careers that have similar education requirements but different qualifications? product safety engineers and materials engineers industrial safety engineers and industrial health engineers quality control systems managers and inspectors industrial safety and health engineers and hand packers
Answers: 3
image
Computers and Technology, 24.06.2019 17:40, HealTheWorld
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print β€œbad input.” and terminate immediately
Answers: 2
image
Computers and Technology, 25.06.2019 02:30, corinnerodriguez2001
How to delete a question in
Answers: 2
Do you know the correct answer?
Create an interface called Runner. The interface has an abstract method called run() that displays a...

Questions in other subjects:

Konu
Mathematics, 27.10.2021 14:00