![]() If a is true, assign the result to be yes. You can’t just assign null to them, as we tried above. All of the types that we’ve used so far in this series - such as String, Int, and Boolean - require you to assign an actual value. ![]() Transforming example using run: val companyName = user?. The code is simple, straightforward, and easy to read. In Kotlin, we use different types to indicate whether a variable can or cannot be set to null. You can use the Kotlin extension functions apply() or run() depending on whether you want it to be fluent ( returning this at end) or transforming ( returning a new value at end): ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |