Created
June 17, 2020 21:23
-
-
Save luissilvazup/5d82e4e8da8115e2e19c51e3aac1178f to your computer and use it in GitHub Desktop.
ISP Solution Part 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class I_InterfaceSegregationSolution { | |
public interface Car { | |
void openDoor(); | |
} | |
public interface ElectricCar { | |
void charge(); | |
} | |
public static class Fiesta implements Car { | |
@Override | |
public void openDoor() { | |
//abrir a porta | |
} | |
} | |
public static class FocusElectric implements Car, ElectricCar { | |
@Override | |
public void charge() { | |
//recarregar | |
} | |
@Override | |
public void openDoor() { | |
//abrir porta | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment