Skip to content

Commit 1093216

Browse files
committed
Remove redundant code example.
1 parent 047f5d7 commit 1093216

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,6 @@ val String.numberOfBs: Int
140140
Scala requires a companion object to have the same name as its companion class, and it has to be in the same file. In Kotlin however it is required to be within the class and use the keywords `companion object`. Object name, in that case, is optional, which makes things a bit interesting. And finally, you can have only one companion object within your class.
141141

142142
```kotlin
143-
data class Items(val items: List<Int>) {
144-
145-
val emptyItems = empty()
146-
val anotherEmptyItems = Builder.empty()
147-
148-
companion object Builder {
149-
fun fromString(s: String): Items = Items(s.split(",").map { it.toInt() })
150-
fun empty(): Items = Items(listOf())
151-
}
152-
}
153-
154143
data class Items(val items: List<Int>) {
155144

156145
fun playWithTest() {

0 commit comments

Comments
 (0)