Which of the following is a method having same name as that of its class?
A. finalize
B. delete
C. class
D. constructor
Answer:D
Which of the following is a method having same name as that of its class?
A. finalize B. delete C. class D. constructor
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.