1.

Which specifier applies only to the constructors?(a) Public(b) Protected(c) Implicit(d) ExplicitI got this question during a job interview.My enquiry is from Types of Constructors in section Constructors and Destructors of Object Oriented Programming

Answer»

The correct choice is (d) Explicit

The best I can explain: The KEYWORD explicit can be USED while DEFINING the constructor only. This is used to SUPPRESS the implicit call to the constructor. It ensures that the CONSTRUCTORS are being called with the default syntax only (i.e. only by using object and constructor name).



Discussion

No Comment Found

Related InterviewSolutions