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();In the scenario described in the accompanying figure, what will the first statement do?

A. The cost method in Honda will be called.
B. The cost method in Car will be called.
C. Nothing will be called since the code will not compile as a result of multiple definitions of speed.
D. Overloading will be used to determine which cost method to use.


Answer: A

Computer Science & Information Technology

You might also like to view...

In order to add or remove an event from a delegate, you would use:

a) the Add and Remove methods b) the Add and Subtract methods c) the += and the -= operators d) events can only be added with the += and not removed from a delegate

Computer Science & Information Technology

The ScrollBars property indicates whether the text box has no scroll bars, a horizontal scroll bar, a vertical scroll bar, or both horizontal and vertical scroll bars.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The system prompt consists of the current default drive, the current directory, and a __________ symbol.

a. less than (<) b. greater than (>) c. either A or B d. neither A nor B

Computer Science & Information Technology

________ are tools and commands accessible from the Formulas tab that help you check your worksheet for errors

Fill in the blank(s) with correct word

Computer Science & Information Technology