Sealed Classes
KotlinBytes - Sealed Classes
Have you ever wondered what a sealed class is? When I first started to learn Kotlin, it took me forever to grasp when and how to use them. Hopefully, I can take what I have learned to help you guys understand a bit quicker. Let's get started!
Chapters:
0:00 - Intro
0:20 - What are Sealed Classes
0:34 - Setting up the Example
1:08 - Difference from Typical Class Inheritance
1:35 - Use Sealed Classes with a "when" Expression
3:03 - Testing
3:19 - What if you do not use Sealed Classes?
4:12 - When to use Sealed Classes
4:51 - Wrapping Up
Source code:
https://github.com/jacobklewis/Scratch-Notes/tree/master/src/main/kotlin/me/jacoblewis/sealed
Additional Resources:
https://kotlinlang.org/docs/reference/sealed-classes.html
Music:
Past (Move On) by | e s c p | https://escp-music.bandcamp.com
Music promoted by https://www.free-stock-music.com
Attribution 4.0 International (CC BY 4.0)
https://creativecommons.org/licenses/by/4.0/
Видео Sealed Classes канала KotlinBytes
Have you ever wondered what a sealed class is? When I first started to learn Kotlin, it took me forever to grasp when and how to use them. Hopefully, I can take what I have learned to help you guys understand a bit quicker. Let's get started!
Chapters:
0:00 - Intro
0:20 - What are Sealed Classes
0:34 - Setting up the Example
1:08 - Difference from Typical Class Inheritance
1:35 - Use Sealed Classes with a "when" Expression
3:03 - Testing
3:19 - What if you do not use Sealed Classes?
4:12 - When to use Sealed Classes
4:51 - Wrapping Up
Source code:
https://github.com/jacobklewis/Scratch-Notes/tree/master/src/main/kotlin/me/jacoblewis/sealed
Additional Resources:
https://kotlinlang.org/docs/reference/sealed-classes.html
Music:
Past (Move On) by | e s c p | https://escp-music.bandcamp.com
Music promoted by https://www.free-stock-music.com
Attribution 4.0 International (CC BY 4.0)
https://creativecommons.org/licenses/by/4.0/
Видео Sealed Classes канала KotlinBytes
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
How to Make Your Code Clean With Kotlin Sealed ClassesContext Receivers Are Coming to Kotlin!Kotlin inline / crossinline / noinline FunctionsSCALA: Don't use exceptionsSealed classes - Kotlin VocabularyHow to get started with Qt Creator | C++ GUI | Libraries | Qt Designer | Cross platformJava Tutorial - Sealed Classes and Interfaces | JDK 17 (Face Reveal)Abstract Classes and Methods - Learn Abstraction in JavaKotlin Fundamentals - 25, Sealed ClassesCreate a Kotlin Short Link Web AppPython OOP Tutorial 6: Property Decorators - Getters, Setters, and DeletersHow to Implement Two interfaces with Same Method Signature in C#Kotlin Callbacks, Closures & LambdasLet, Also, Apply, Run, With - Kotlin Scope FunctionsKotlin Sealed Class (With Demo Source code)Sealed Classes in KotlinScala Tutorials - Day 28 | Exception Handling in ScalaKotlin Interview Question - Part 1LAMBDAS en KOTLIN - Tutorial | #10Python OOP Tutorial 1: Classes and Instances