1.

Which of the following is a method having same name as that of its class?(a) finalize(b) delete(c) class(d) constructorI have been asked this question in examination.My question is based upon Constructors & Garbage Collection in division Classes and Methods of Java

Answer»

The correct choice is (d) CONSTRUCTOR

The explanation: A constructor is a method that initializes an OBJECT immediately UPON creation. It has the same name as that of class in which it resides.



Discussion

No Comment Found

Related InterviewSolutions