Sealed Class
[코틀린 인 액션] 4장 정리
4.1.4 내부 클래스와 중첩된 클래스 1. 클래스 A 안에 정의된 클래스 A는 중첩 클래스 - 내부 클래스 선언을 위해서는 inner 키워드 사용 class Outer { private val bar: Int = 1 class Nested { fun foo() = 3 } inner class Inner() { fun foo() = bar } } val demo = Outer.Nested().foo() val demo2 = Outer().Inner().foo() 2. Nested 클래스는 Outer 클래스의 내부 클래스가 아니므로 프로퍼티에 접근 불가능 class Outer { private val bar: Int = 1 class Nested { fun foo() = bar // ERROR } inne..