Java
Programming and Technical
Q. What is Constructor?
A. A constructor is a special method whose task is to initialize the object of its class. It is special because its name is the same as the class name. They do not have return types, not even void and therefore they cannot return values. They cannot be inherited, though a derived class can call the base class constructor. Constructor is invoked whenever an object of its associated class is created.
Read Solution (Total 2)
-
- constructor is non-static defination block.it is used to initialize non-static variable.it's name is also same as class name.constructor is called at the time of object creation.minimum 2 constructor is executed at the time of object creation and maximum depends on super or this statement inside constructor...
- 10 years agoHelpfull: Yes(0) No(0)
- constructor is a special type of method which is used to initialize the variables at the time of object creation.constructor can be inherited.
- 10 years agoHelpfull: Yes(0) No(0)
Java Other Question