2023-03-02 15:26:42 +02:00
|
|
|
package encapsulationInheritancePolymorphism.polymorphism;
|
|
|
|
|
|
|
|
public class ElectricEngine extends Engine {
|
|
|
|
private String batteryType;
|
|
|
|
|
2023-03-02 15:48:38 +02:00
|
|
|
@Override
|
2023-03-02 15:26:42 +02:00
|
|
|
public int getPower() {
|
|
|
|
return 20;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*private class Engine {
|
|
|
|
private int power;
|
|
|
|
}*/
|
|
|
|
}
|