You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -724,7 +724,7 @@ val charon2 = charon.copy(age = 19)
724
724
- 数据类必须拥有一个构造方法,该方法至少包含一个参数,一个没有数据的数据类是没有任何用处的。
725
725
- 与普通的类不同,数据类构造方法的参数强制使用var或者val进行声明
726
726
- data class之前不能用abstract、open、sealed或者inner进行修饰
727
-
- 在Kotlin 1.1版本前数据类只允许实现接口,之后的版本既可以实现接口也可以继承类
727
+
- 在Kotlin 1.1版本前数据类只允许实现接口,之后的版本既可以实现接口也可以继承类,更多可看[Feedback Request: Limitations on Data Classes](https://blog.jetbrains.com/kotlin/2015/09/feedback-request-limitations-on-data-classes/)
如果在项目中使用了大量的数据类,那就会引起包大小增加的问题。具体可见[Data classes in Kotlin: how do they impact application size](https://medium.com/bumble-tech/data-classes-in-kotlin-the-real-impact-of-using-it-6f1fdc909837)
0 commit comments