Skip to content

Instantly share code, notes, and snippets.

View AditChauhan's full-sized avatar
:atom:

Adit Chauhan AditChauhan

:atom:
  • india
View GitHub Profile
@AditChauhan
AditChauhan / SealedError.kt
Created March 14, 2020 06:36
SealedError
fun main(args: Array<String>)
{
var whatTime = Time() //compiler error. Class Time cannot be instantiated.
}
@AditChauhan
AditChauhan / Sealed.kt
Created March 14, 2020 06:33
SealedExample
sealed class Time{
class Past : A()
class Present : A()
class Future : A()
}