1.

What Are The Different Types Of Constructors In Kotlin?

Answer»

There are two types of constructors in Kotlin:

  • PRIMARY constructor: It is a section of the CLASS header and is declared after the class NAME.
  • Secondary constructor: This constructor is declared inside the body.
  • Note: There can be more secondary constructors for a class.

There are two types of constructors in Kotlin:



Discussion

No Comment Found