a guest May 26th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.
  5. var nullTest: Int? = null
  6. println(nullTest?.inc() ?:0)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand