Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Practice Time: Null Checks
- // Create a nullable integer variable called nullTest, and set it to null.
- // Use a null-check that increases the value by one if it's not null, otherwise returns 0, and prints the result.
- var nullTest: Int? = null
- println(nullTest?.inc() ?:0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement