Created
August 9, 2022 10:50
-
-
Save devrath/cad9757d36fd3aba4000aae3f7c0bf71 to your computer and use it in GitHub Desktop.
Defining the sealed class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sealed class Animal { | |
| object Cat : Animal() // We can define a Object classes like this | |
| data class Dog(val name: String) : Animal() // We can define data classes like this | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment