![]() This might sound crazy, but this makes sense for example when you need to use the Parceler interface in combination with the annotation using kotlin-android-extensions (to simplify the creation of CREATORs). Now, this might seem crazy, but it has the super-nice benefits that lets you inherit "static functions" from interfaces into your companion object. Instead, Kotlin introduces the concept of companion objects that store static fields and methods. String someUglyMutableField = MålassWithStatics. println( SOME_CONSTANT + " " + someUglyMutableField) Public static String someUglyMutableField = "don't do this like ever" Public static final String SOME_CONSTANT = "Hello!" ![]() With all that in consideration, an interface like this: Vars can have different visibility modifiers, for example a public getter, but private setter. Package guide.to.kotlin abstract class BaseClass. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |