Advertisement
Guest User

Untitled

a guest
May 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. // Practice Time: Null Checks
  2. // Create a nullable integer variable called nullTest, and set it to null.
  3. // Use a null-check that increases the value by one if it's not null, otherwise returns 0, and prints the result.
  4.  
  5. var nullTest: Int? = null
  6. println(nullTest?.inc() ?:0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement