Skip to content

Instantly share code, notes, and snippets.

@ParkSangGwon
Created January 10, 2022 02:04
Show Gist options
  • Save ParkSangGwon/b2829602aa2390fe25a3179d99cb9dc5 to your computer and use it in GitHub Desktop.
Save ParkSangGwon/b2829602aa2390fe25a3179d99cb9dc5 to your computer and use it in GitHub Desktop.
sealed class User(open val name: String) {
data class Customer(
override val name: String,
val address: String,
val phoneNumber: String
) : User(name)
data class Store(
override val name: String,
val address: String,
val businessNumber: String
) : User(name)
data class Admin(
override val name: String,
val department: String
) : User(name)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment