Intro to Kotlin (Nullables, Data Classes, Enum Classes and Sealed Classes)

in #utopian-io8 years ago (edited)

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



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

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!

Hey @tensor I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.097
BTC 62177.10
ETH 1736.72
USDT 1.00
SBD 0.39