When can you omit the constructor keyword from the primary constructor?
A. It can be omitted only if an init block is defined
B. It can be omitted anytime; it is not mandatory
C. It can be omitted if secondary constructors are defined
D. It can be omitted when the primary constructor does not have any modifiers or annotations
Answer: Option D
Related Questions on Kotlin Program
A. A new version of Java.
B. A JavaScript framework.
C. A statically-typed programming language for the JVM, Android, and browser.
D. A database management system.
Which platform does Kotlin primarily target?
A. Python Bytecode
B. JavaScript
C. JVM (Java Virtual Machine) Bytecode
D. PHP

Join The Discussion