You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
val order =Order(listOf(Item("Bread", 25.0F), Item("Wine", 29.0F), Item("Water", 12.0F)))
18
19
@@ -22,6 +23,7 @@ fun main(args: Array<String>) {
22
23
23
24
}
24
25
```
26
+
25
27
</div>
26
28
27
29
1. We define simple models of `Item` and `Order`. `Order` can contain arbitrary `Collection` of `Item` s
@@ -34,13 +36,15 @@ is very much like standard function or property signature, with addition that we
34
36
It is even possible to execute extensions on `null` references. In their implementation we can check for `null` reference and based on that we can do any arbitrary logic. Example:
35
37
36
38
<divclass="language-kotlin"theme="idea">
39
+
37
40
```kotlin
38
41
//sampleStart
39
42
fun <T> T?.nullSafeToString() =this?.toString() ?:"NULL"// 1
0 commit comments