RE: [Kotlin] getter/setter를 설정해야 하는 귀찮음 제거 data class

You are viewing a single comment's thread from:

[Kotlin] getter/setter를 설정해야 하는 귀찮음 제거 data class

in kotlin •  3 years ago 

setter 가 만들어지려면 val 대신 var 를 사용하면 되겠어요.
data class는 프로퍼티에 대한 toString(), hashCode(), equals(), copy() 메소드를 자동으로 만들어주는 기능이에요.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!