Examlex

Solved

Consider a Class Hierarchy That Includes a Class Called Vehicle

question 12

Essay

Consider a class hierarchy that includes a class called Vehicle, with subclasses called Car and Airplane. The Vehicle class has a method called getMaxSpeed, which is overridden in the Car class. The getMaxSpeed of the Vehicle class returns 760 mph, while the getMaxSpeed method of the Car class is overridden to return 150 mph. What is the output of the following snippet of code? Explain your answer.
Vehicle v = new Car();
System.out.println(v.getMaxSpeed() + " mph");


Definitions:

Plantar Flexes

The movement decreasing the angle between the dorsum of the foot and the leg, for example, standing on tiptoes.

Fibularis Brevis

A muscle of the lower leg that assists in plantar flexing and everting the foot.

Calf Bulge

The appearance of an enlarged or prominent portion of the calf muscle on the back of the lower leg.

Gastrocnemius

A major muscle in the calf of the leg, involved in walking, running, and jumping.

Related Questions