-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiple Types with the same name in different packages
- Loading branch information
1 parent
f9d6f0a
commit d8e8991
Showing
5 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
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
16 changes: 16 additions & 0 deletions
16
...lin-crums-3/src/main/kotlin/org/jesperancinha/ktd/crums3/multiple/MultipleSameTypeCats.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.jesperancinha.ktd.crums3.multiple | ||
|
||
import org.jesperancinha.ktd.crums3.multiple.cat1.CatTalker as BobCat | ||
import org.jesperancinha.ktd.crums3.multiple.cat2.CatTalker as TimCat | ||
import org.jesperancinha.ktd.crums3.multiple.cat3.CatTalker as Geoffrey | ||
|
||
class MultipleSameTypeCats { | ||
companion object { | ||
@JvmStatic | ||
fun main(args: Array<String> = emptyArray()) { | ||
println(BobCat().getSound()) | ||
println(TimCat().getSound()) | ||
println(Geoffrey().getSound()) | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...rg-kotlin-crums-3/src/main/kotlin/org/jesperancinha/ktd/crums3/multiple/cat1/CatTalker.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.jesperancinha.ktd.crums3.multiple.cat1 | ||
|
||
class CatTalker { | ||
fun getSound() = "miauuuuu!" | ||
} |
5 changes: 5 additions & 0 deletions
5
...rg-kotlin-crums-3/src/main/kotlin/org/jesperancinha/ktd/crums3/multiple/cat2/CatTalker.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.jesperancinha.ktd.crums3.multiple.cat2 | ||
|
||
class CatTalker { | ||
fun getSound() = "chirp chirp!" | ||
} |
5 changes: 5 additions & 0 deletions
5
...rg-kotlin-crums-3/src/main/kotlin/org/jesperancinha/ktd/crums3/multiple/cat3/CatTalker.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.jesperancinha.ktd.crums3.multiple.cat3 | ||
|
||
class CatTalker { | ||
fun getSound() = "aoooouuuuuu!" | ||
} |