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
gavmur [86]
3 years ago
5

Suppose a class Car and its subclass Honda both have a method called speed as part of the class definition. rentalH refers to an

object of the type Honda and the following statements are found in the code: rentalh.cost(); super.speed(); what will the first statement do?
A. Nothing will be called since the code will not compile as a result of multiple definitions of speed.
B. The cost method in Car will be called.
C. The cost method in Honda will be called.
D. Overloading will be used to determine which cost method to use.
Computers and Technology
1 answer:
Westkost [7]3 years ago
6 0

Answer:

C. The cost method in Honda will be called.

Explanation:

The first statement will cause the cost method in Honda to be called. This is because rentalh is a object of the subclass Honda. Therefore, any method that is called using this object variable will target the elements within the Honda subclass. In this case, the cost() method is being called using the rentalh variable which will look for the cost() method within the scope of the Honda subclass. In order to target the parent class Car it would need to be called using the super variable as in statement 2.

You might be interested in
What is the difference between a technological problem and a technological opportunity? Explain with an example.
BigorU [14]
I will explain this concept using an example for Small Businesses.

The concept of Frustrated Users (Employees) is an example of a technological problem. Interacting with technology is a huge part of the employees’ day. Using slow, outdated systems with frequent problems makes it much more difficult for them to be happy and productive.

How would it impact a business if the company enabled the employees to get just 5 percent more accomplished every day? the answer is simply by keeping the technology up to date. So, the problem exposed above allows the company to find new ways and opportunities to make the job easier.

The company would need to establish a training plan for the employees. Maybe establishing a diploma course that allows them to learn and know better the new technologies.
7 0
4 years ago
Read 2 more answers
What is the difference between KE an PE
PtichkaEL [24]
KE is the energy possessed by an object by virtue of it being in motion. PE is the energy possessed by an object by virtue of its position. It can be transferred from one object to another and this happens during collisions. Potential Energy, on the other hand, cannot be transferred from one object to another.
3 0
3 years ago
Which one of the following features can control left and right indents using markers?
abruzzese [7]
D) The styles pane.

Word normally applies the chosen formatting commands when a style is applied. To control the left or the right indent (distance of a paragraph from the left or right of a margin) in a document using markers, one has to use the styles pane.






4 0
3 years ago
Read 2 more answers
Stopping, standing, or parking is prohibited _____________.
DENIUS [597]
B within an intersection or on a crosswalk
8 0
3 years ago
hi Let's say you graduate from school and you are unemployed or take a low-paying job. What are your debt repayment options if y
maks197457 [2]

Income-Based Repayment would be one of your repayment options.

IBR is an option similar to Pay As You Earn but offers more flexibility. To qualify for an IBR, your prospective payments must be lower than they would be on the Standard Repayment Plan. You can still sign up for an IBR even if you are still unemployed. These plans are solely based on your income. So if you are unemployed, this translates to zero income. As a result, your monthly payment will be $0

4 0
4 years ago
Read 2 more answers
Other questions:
  • If you choose a career, you will always be satisfied with your work.<br> True<br> False
    7·2 answers
  • Which of the following keys on a keyboard allows you to select multiple cells located in different parts of your worksheet?
    13·2 answers
  • Choose the false statement below. The content that displays in the browser is contained in the head section. The content that di
    14·1 answer
  • PowerPoint:
    7·2 answers
  • Select the correct answer.
    9·2 answers
  • To celebrate me reaching expert in the same day i made the account im doing a point giveaway
    12·2 answers
  • Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
    13·1 answer
  • _______________ ________________ have human editors that evaluate, select, and organize websites into a hierarchy of categories.
    11·1 answer
  • What are a few ways to format the text in a mail message in Outlook? Check all that apply.
    7·2 answers
  • Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burn
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!