Vidyalelo
Computer Science · Q154

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 154

Q154

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

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board