- object expressions are executed (and initialized) immediately, where they are used;
- object declarations are initialized lazily, when accessed for the first time;
- a companion object is initialized when the corresponding class is loaded (resolved), matching the semantics of a Java static initializer.
https://kotlinlang.org/docs/reference/object-declarations.html#companion-objects
541

被折叠的 条评论
为什么被折叠?



