Practice OOP-SOLID (Interface Segragation)

Run Settings
LanguageJava
Language Version
Run Command
class Main { public static void main(String[] args) { System.out.println("Hello World!"); } }
interface VehicleInterface { void drive(); void stop(); void refuel(); //void openDoors(); }
class Motorcycle implements VehicleInterface{ public void drive() { } public void stop() { } public void refuel() { } //pada fungsi ini seharusnya tidak dimiliki oleh motor, sehingga pada prinsip solid ISP, fungsi ini akan dibuat interface baru /*public void openDoors() { }*/ }
interface DoorInterface { void openDoors(); }
class Car implements VehicleInterface, DoorInterface { void drive() { } void stop() { } void refuel() { } void openDoors() { } }
Editor Settings
Theme
Key bindings
Full width
Lines