Virtusa Interview Question

What is constructor? Explain it.

Interview Answer

Anonymous

Apr 8, 2024

Constructor is a special method which name is as same as the class name. Constructor don't have any return type. Constructor gets invoked automatically at the time of object creation