다음과 같이 중괄호없이 Kotlin에서 클래스를 만들 수 있다는 것을 알아 챘습니다.중괄호가없는 Kotlin 클래스
//Example classFile.kt
class Empty
class SecondEmpty
fun firstMethod() {
}
제 질문은 왜 그런 기능이 필요한가요? 어떤 상황에서 이것을 사용할 수 있습니까?
위의 예에서는 firstMethod()
이라는 메서드를 작성하여 다른 개체에서 호출 할 수 있습니까?
관련 항목 : https://stackoverflow.com/questions/47588670/what-is-the-purpose-of-empty-class-in-kotlin – BakaWaii
[Kotlin의 빈 클래스의 목적은 무엇입니까?] (https://stackoverflow.com/questions/47588670/what-is-the-purpose-of-empty-class-in-kotlin) –