1.

Which among the following is false?(a) Constructor can’t be overloaded in Kotlin(b) Constructors can’t be called recursively in java(c) Constructors can be overloaded in C++(d) Constructors overloading depends on different signaturesThis question was addressed to me during an interview.The query is from Overloading Constructors topic in division Constructors and Destructors of Object Oriented Programming

Answer»

The correct option is (a) Constructor can’t be overloaded in KOTLIN

The EXPLANATION: Kotlin LANGUAGE allows constructor OVERLOADING. This is a basic feature for the constructors. The constructor overloading allows the OBJECT to be initialized according to the user.



Discussion

No Comment Found

Related InterviewSolutions