CS FundamentalsModerateWipro · Accenture pattern

A class diagram shows Vehicle as a superclass with a generalization (hollow triangle arrow) pointing from Car and Truck up to Vehicle. If Vehicle declares an abstract method `startEngine()`, what must Car and Truck each do?

  1. A. Only one of Car or Truck needs to implement it; the other can remain abstract
  2. B. The hollow triangle means Car and Truck must implement every method with a completely different signature
  3. C. Each must provide its own concrete implementation of startEngine(), since Vehicle's version is abstract and cannot be used directly
  4. D. They inherit a working startEngine() and never need to override it

Correct answer: C. Each must provide its own concrete implementation of startEngine(), since Vehicle's version is abstract and cannot be used directly

A hollow-triangle generalization models inheritance (is-a). An abstract method has no body in the superclass, so every concrete subclass (Car, Truck) must supply its own implementation before it can be instantiated.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic