Last active
September 21, 2020 06:48
-
-
Save aleksandarzekovic/7c14fe101347ec104b37f0d1e7fc0a70 to your computer and use it in GitHub Desktop.
Class for explain DI
This file contains hidden or 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
| class Engine{ | |
| fun turnOn() { | |
| Log.d("TAG", "Engine is turn on") | |
| } | |
| } | |
| class Transmission { | |
| } | |
| class Car constructor(private val engine: Engine, private val transmission: Transmission) { | |
| fun startCar(){ | |
| engine.turnOn() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment