Skip to content

Instantly share code, notes, and snippets.

@NitinPraksash9911
Created January 12, 2021 16:36
Show Gist options
  • Save NitinPraksash9911/b1d343d073d5303769e149111562139d to your computer and use it in GitHub Desktop.
Save NitinPraksash9911/b1d343d073d5303769e149111562139d to your computer and use it in GitHub Desktop.
public interface Car {
void turnOnEngine();
void accelerate();
}
public class MotorCar implements Car {
private Engine engine;
public void turnOnEngine() {
//turn on the engine!
engine.on();
}
public void accelerate() {
//move forward!
engine.powerOn(1000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment