Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

sealed class in kotlin example

sealed interface Expr

sealed class MathExpr(): Expr

data class Const(val number: Double) : MathExpr()

data class Sum(val e1: Expr, val e2: Expr) : MathExpr()

object NotANumber : Expr
Source by tedblob.com #
 
PREVIOUS NEXT
Tagged: #sealed #class #kotlin
ADD COMMENT
Topic
Name
3+2 =