Created
January 31, 2017 16:48
-
-
Save ifucolo/863ec1516067218c4087f05018bd6745 to your computer and use it in GitHub Desktop.
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 interface Car { | |
public void startEngine(); | |
} | |
public Ferrari implements Car { | |
... | |
@Override | |
public double startEngine() { | |
//logic ... | |
} | |
} | |
=public Tesla implements Car{ | |
... | |
@Override | |
public double startEngine() { | |
if (!IsCharged) | |
return; | |
//logic ... | |
} | |
} | |
public void letStartEngine(Car car) { | |
car.startEngine(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment