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 working principle of computer?
ankoles [38]
The CPU is the working principle
8 0
4 years ago
Any mobile devices contain a(n) ___ and gyroscope that can sense even the smallest movements.
mars1129 [50]

Any mobile device contains a(n) accelerometer and gyroscope that can sense even the smallest movements.

<h3>What are accelerometers? What does an accelerometer sensor do in mobile phones?</h3>

The orientation of a mobile phone is determined by the accelerometer in the device. The gyroscope, or gyro for short, tracks rotation or twist to provide another dimension to the data provided by the accelerometer.

A smartphone's built-in accelerometer measures the device's acceleration. It tracks the different motions like shaking, tilting, swinging, and rotating and accordingly changes the orientation of your app. The accelerometer utilizes the value of XYZ to determine and detect motion.

To know more about accelerometer , Visit:

<u>brainly.com/question/27960990</u>

#SPJ4

7 0
2 years ago
What is one way to measure technological progress?
OLga [1]
You can measure it by the amount of automatisation. The bigger technological process the easier it is to automate systems.
4 0
3 years ago
What type of coverage pays for damage incurred as a result of theft, vandalism, fire or natural disaster?
Sloan [31]

Comprehensive or hazard insurance

5 0
3 years ago
Review the sentences about the accounting problem statement. Using the drop-down menu, identify if the sentence is part of the v
Tju [1.3M]
Issue
Method
Issue
Vision
8 0
4 years ago
Other questions:
  • The following method public String removeFromString(String old, String frag) removes all occurences of the string frag from the
    12·1 answer
  • Consider the following scheduling problem. You are given a list of final exams F1,...,Fk tobescheduled,andalistofstudentsS1,...,
    10·1 answer
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • Which TWO objects are likely to have SSD chips in them?
    5·2 answers
  • Assume you are using the text's array-based queue and have just instantiated a queue of capacity 10. You enqueue 5 elements and
    13·1 answer
  • I’ll give brainliest if answers are correct
    11·1 answer
  • Is it possible build a real time machine?
    7·2 answers
  • Designations at the end of file names such as .docx and .html are called
    7·1 answer
  • What does c++ programming mean?
    7·1 answer
  • Yeoo check dis out!!!!!! wait my full vid dont show hol on
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!