File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ interface SoundBehavior {
7
7
fun makeSound()
8
8
}
9
9
10
- class ScreamBehavior(val n:String): SoundBehavior { // 2
10
+ class ScreamBehavior(val n: String): SoundBehavior { // 2
11
11
override fun makeSound() = println("${n.uppercase()} !!!")
12
12
}
13
13
14
- class RockAndRollBehavior(val n:String): SoundBehavior { // 2
14
+ class RockAndRollBehavior(val n: String): SoundBehavior { // 2
15
15
override fun makeSound() = println("I'm The King of Rock 'N' Roll: $n")
16
16
}
17
17
18
18
// Tom Araya is the "singer" of Slayer
19
- class TomAraya(n:String): SoundBehavior by ScreamBehavior(n) // 3
19
+ class TomAraya(n: String): SoundBehavior by ScreamBehavior(n) // 3
20
20
21
21
// You should know ;)
22
- class ElvisPresley(n:String): SoundBehavior by RockAndRollBehavior(n) // 3
22
+ class ElvisPresley(n: String): SoundBehavior by RockAndRollBehavior(n) // 3
23
23
24
24
fun main() {
25
25
val tomAraya = TomAraya("Thrash Metal")
You can’t perform that action at this time.
0 commit comments