Intro to Kotlin (Nullables, Data Classes, Enum Classes and Sealed Classes)
What Will I Learn?
- You will learn about Data Classes, Enum Classes and Sealed Classes in Kotlin
- You will learn about Nullability and the Null Safety operators in Kotlin
- You will learn how to use laziness to your advantage with classes in Kotlin
Requirements
- The Kotlin Compiler or The Intellij/Eclipse IDE
- A basic understanding of the JVM as a platform
- A little knowledge of the Object Oriented Programming paradigm
Difficulty
- Intermediate
Description
In this video tutorial, we look at some of the more advanced features of Kotlin's Class System and its Null Safety Type System. First, we look at the Nullable operators in Kotlin: the Safe Call Operator (.?), the Not-Null Assertion Operator (.!!) and the Elvis Operator (:?). We then look at the lateinit keyword which allows us to avoid having to initialize our class properties until we have a value. Then we look at Data Classes and how much boilerplate code they remove from our programs. We also talk about how we can use Data Classes to model the data in our programs and how they can work like Tuples and Structs from other languages. We look at how we can create nested classes and inner classes in Kotlin. We take a look at Enum classes which let us define and create groups of constants in our applications. Finally, we talk about Sealed Classes and how they allow us to define class hierarchies in Kotlin.
Video Tutorial
Curriculum
- Intro to Kotlin (Basic Types, Type Inference, Casting and Strings)
- Intro to Kotlin (Basic Operations and Collections)
- Intro to Kotlin (Control Flow and Conditionals)
- Intro to Kotlin (Functions in Kotlin)
- Intro to Kotlin (Advanced Functions)
- Intro to Kotlin (Classes, Visibility Modifiers, Objects)
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Thank you ewq as always for watching my content.
Great post!
Being A SteemStem Member
Hey @tensor I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x