Static Blocks
Static blocks and companions objects in kotlin, variables, methods, class
When you need an initialization of a block of code when a class in Kotlin is created, you need to create a companion block. The companion block is the equivalent to a static block in Java.
An example of a companion block / static:
class MyClass {
companion object {
init {
}
}
}
For more details on companion blocks go here.
Next: Annotations