A constructor is a concise way to initialize class properties . It is a special member function that is called when an object is instantiated (created). However, how they work in Kotlin is slightly different. In Kotlin, there are two constructors: Primary constructor – concise way to initialize a class.