Kotlin Programming: The Big Nerd Ranch Guide by Josh Skeen & David Greenhalgh

Kotlin Programming: The Big Nerd Ranch Guide by Josh Skeen & David Greenhalgh

Author:Josh Skeen & David Greenhalgh [Skeen, Josh]
Language: eng
Format: epub
Tags: Big Nerd Ranch Guides, COM051010, Kotlin Programming, Android Programming
ISBN: 9780135162361
Publisher: Big Nerd Ranch Guides
Published: 2018-06-14T23:00:00+00:00


This code compiles, thanks to the also standard function. Instead of referring to the class property, it, the argument to also, is a local variable that exists only within the scope of the anonymous function. Therefore, the it variable is guaranteed to not be changed by another part of your program. The smart cast issue is avoided entirely, because instead of dealing with the original nullable property, this code uses a read-only, non-nullable local variable (since also is called after the safe call operator: weapon?.also).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.