When init block execute?
The code inside the init block is the first to be executed when the class is instantiated. The init block is run every time the class is instantiated, with any kind of constructor.
Even if the class has no primary constructor, the delegation still happens implicitly, and the initializer blocks are still executed
网友评论