Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Null-object/Kotlin/null-object.kotlin
Normal file
9
Task/Null-object/Kotlin/null-object.kotlin
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// version 1.1.0
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val i: Int = 3 // non-nullable Int type - can't be assigned null
|
||||
println(i)
|
||||
val j: Int? = null // nullable Int type - can be assigned null
|
||||
println(j)
|
||||
println(null is Nothing?) // test that null is indeed of type Nothing?
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue