add polymorphism example

This commit is contained in:
Oleksii Aleshchenko
2023-03-02 15:26:42 +02:00
parent 4b159fa22b
commit 429bcc7b3d
8 changed files with 123 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package encapsulationInheritancePolymorphism.polymorphism;
public class ElectricEngine extends Engine {
private String batteryType;
public int getPower() {
return 20;
}
/*private class Engine {
private int power;
}*/
}