kotlin var init check

Kotlin is a modern programming language that runs on the Java Virtual Machine (JVM) and can also be compiled to JavaScript source code. It is known for its conciseness, expressiveness, and safety features. In Kotlin, the "var" keyword is used to declare a mutable variable, while the "val" keyword is used to declare an immutable variable.

The "init" keyword in Kotlin is used to define an initialization block. Initialization blocks are executed when an instance of a class is created or when an object is initialized. They are used to perform initialization logic that cannot be done in the constructor.

The "check" keyword in Kotlin is used to perform a boolean check on a condition. It throws an IllegalStateException if the condition is false.

To summarize, the given code snippet declares a mutable variable using the "var" keyword, and then defines an initialization block using the "init" keyword. Inside the initialization block, a check is performed using the "check" keyword. If the condition in the check is false, an IllegalStateException will be thrown.