nerdexam
Oracle

1Z0-819 · Question #18

Given: ``java public class Sportscar extends Automobile { private float turbo; public void setTurbo (float turbo) { this.turbo = turbo; } } `` What is known about the Sportscar class?

The correct answer is A. The Sportscar class is a subclass of Automobile and inherits its methods. See the full explanation below for the reasoning.

Question

Given:
public class Sportscar extends Automobile {
 private float turbo;

 public void setTurbo (float turbo) {
 this.turbo = turbo;
 }
}
What is known about the Sportscar class?

Options

  • AThe Sportscar class is a subclass of Automobile and inherits its methods.
  • BThe Sportscar subclass cannot override setTurbo method from the superclass Automobile.
  • CThe Sportscar class is a superclass of Automobile and inherits methods from Automobile.
  • DThe Sportscar class inherits the setTurbo method from the superclass Automobile.

How the community answered

(26 responses)
  • A
    81% (21)
  • B
    4% (1)
  • C
    4% (1)
  • D
    12% (3)

Community Discussion

No community discussion yet for this question.

Full 1Z0-819 Practice