Car and Engine Using Composition
I would model Car and Engine using composition rather than creating separate inheritance hierarchies such as PetrolCar, DieselCar, and ElectricCar. The Car depends on an IEngine abstraction, and concrete engines implement the behavior. This follows programming to an interface and makes adding another engine type possible without modifying Car.
Car has an Engine rather than inheriting from an engine.
The engine abstraction isolates Car from concrete engine implementations.
New engines can be introduced without modifying Car.
Dependency injection can select the engine at runtime or configuration time.
This design supports Open/Closed Principle and composition over inheritance.