a guest May 26th, 2019 67 Never
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)
RAW Paste Data