1.

The objects in an object array _______________________(a) Can be created without use of constructor(b) Can be created without calling default constructor(c) Can’t be created with use of constructor(d) Can’t be created without calling default constructorThe question was asked in unit test.I would like to ask this question from Object Array topic in portion Object of Object Oriented Programming

Answer»

Right answer is (b) Can be created WITHOUT calling default CONSTRUCTOR

The explanation is: The objects need some constructor to get the memory spaced reserved for those. If the default constructor is not used then we can use some ARGUMENTS constructor which will RESERVE the memory for the objects. The objects can be passed with constructor arguments during declaration.



Discussion

No Comment Found

Related InterviewSolutions