1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
svlad2 [7]
3 years ago
11

Create an interface called Runner. The interface has an abstract method called run() that displays a message describing the mean

ing 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
}
----------------------------------------------------------------------------------------------------

Computers and Technology
1 answer:
4vir4ik [10]3 years ago
5 0

Answer:

Please find the code and its output in the attached file.

Explanation:

In the above-given code, an interface "Runner" is defined, inside the interface, an abstract method run is declared.

In the next step, three class "Athlete, Machine, and PoliticalCandidate" s defined that implements the run method, and use the print message that holds a given value as a message.

In the next step, a class "DemoRunners" is defined, and inside the main method, the three-class object is declared, which calls the run method.

 

You might be interested in
In every organization, workers receive and sendinformation daily. The flow of this information should be____________.upward and
Aleks [24]

Answer:

upward and downward

Explanation:

4 0
3 years ago
George wants to pursue a career in web technology as a web developer. Which certifications can help him as a web developer?
skelet666 [1.2K]

Answer:Google Analytics IQ.

he can use this

Explanation:

3 0
3 years ago
A good algorithm should have which three components?
DiKsa [7]

A good algorithm should have these three components: C. steps, order, and outcomes.

<h3>What is an algorithm?</h3>

An algorithm simply refers to a standard formula which is made up of a set of finite steps and instructions that are executed on a computer system, in order to enable a software solve a particular problem under appropriate conditions.

In Computer technology, there are three (3) components that a good algorithm should have these include the following:

  • Steps
  • Order
  • Outcomes

Read more on algorithm here: brainly.com/question/24793921

#SPJ1

5 0
2 years ago
Question 1 (True/False Worth 3 points)
ANTONII [103]
False because the internet connects with multiple communication networks to exchange information
6 0
2 years ago
Complete the sentence to identify disadvantages of top-down programming design. Choose all that apply. Top-down programming desi
pav-90 [236]

so is it all about codes and codes and codes and codes and codes lol

4 0
3 years ago
Other questions:
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • Which of the following is not a job title associated with a career in visual and audio technology? master control operator produ
    9·1 answer
  • You can add envelopes to existing documents. <br> a. True <br> b. False
    10·1 answer
  • The _____ helps the project team to identify the main functions or features of the system and the different users or external sy
    15·1 answer
  • Which option should you select to accept a tracked change? A. Accept B. Reject C. Review D. Delete
    8·2 answers
  • What are ip addresses? why are these important for forensic scientists?
    5·1 answer
  • Mississippi law codes state that bullying and cyberbullying are against the law. A court can decide to incur ___________________
    10·1 answer
  • Which two features offered by SharePoint
    12·1 answer
  • An epic games service is unavailable at the moment
    8·1 answer
  • Which of the following statements about recommendation engines is TRUE?A: An online recommendation engine is a set of algorithms
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!