diff --git a/examples/07_Delegation/01_delegationPattern.md b/examples/07_Delegation/01_delegationPattern.md index 4b5b27e..9f396da 100755 --- a/examples/07_Delegation/01_delegationPattern.md +++ b/examples/07_Delegation/01_delegationPattern.md @@ -7,19 +7,19 @@ interface SoundBehavior { fun makeSound() } -class ScreamBehavior(val n:String): SoundBehavior { // 2 +class ScreamBehavior(val n: String): SoundBehavior { // 2 override fun makeSound() = println("${n.uppercase()} !!!") } -class RockAndRollBehavior(val n:String): SoundBehavior { // 2 +class RockAndRollBehavior(val n: String): SoundBehavior { // 2 override fun makeSound() = println("I'm The King of Rock 'N' Roll: $n") } // Tom Araya is the "singer" of Slayer -class TomAraya(n:String): SoundBehavior by ScreamBehavior(n) // 3 +class TomAraya(n: String): SoundBehavior by ScreamBehavior(n) // 3 // You should know ;) -class ElvisPresley(n:String): SoundBehavior by RockAndRollBehavior(n) // 3 +class ElvisPresley(n: String): SoundBehavior by RockAndRollBehavior(n) // 3 fun main() { val tomAraya = TomAraya("Thrash Metal")