Oracle
1Z0-851 · Question #258
1Z0-851 Question #258: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #258. The question stem and answer options stay visible for context.
Question
Given: abstract class Vehicle { public int speed() { return 0; } class Car extends Vehicle { public int speed() { return 60; } class RaceCar extends Car { public int speed() { return 150; } ... RaceCar racer = new RaceCar(); Car car = new RaceCar(); Vehicle vehicle = new RaceCar(); System.out.println(racer.speed() + ", " + car.speed() + ", " + vehicle.speed()); What is the result?
Options
- A0, 0, 0
- B150, 60, 0
- CCompilation fails.
- D150, 150, 150
- EAn exception is thrown at runtime.
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.