Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


What is a constructor in class?


Constructor has the same name as the class in which it resides and looks from syntax point of view it looks similiar to a method. Constructor is automatically called immediately after the object is created, before the new operator completes. Constructors have no return type, not even void. This is because the implicit return type of a class' constructor is the class type itself. It is the constructor's job to initialize the internal state of an object so that the code creating an instance will have a fully initialized, usable object immediately.
 

asked Sep 13, 2013 in oops by rajesh
edited Sep 12, 2013
0 votes
21 views



Related Hot Questions



Government Jobs Opening


...