Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val name: String ? = null //assigned null and it will compile also.
- fun getName(): String ? = null //returned null and it will compile too.
- /* wonβt compile */
- val name: String ? = null
- val len = name.length
- /* correct way */
- val name: String ? = null
- val len = name ? .length
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement