October 2018
Intermediate to advanced
982 pages
23h 29m
English
The safe call can be written using the .?. It can be called when the reference holds a non-null value when the value holds a null reference then the null value will be returned:
val hash:TrackedHashTag? = TrackedHashTag(hashTag="java",queue="java")val queueString = hash?.queue
When the hash? holds null, the null value will be assigned to a queueString attribute. If the hash? has a valid reference, the queue attribute will be assigned to a queueString attribute.
Read now
Unlock full access