What is Constructor ?
Ans: Constructor is a special type of method whose name is name is same as per class name.
What is Main purpose of use Constructor ?
Ans: The main purpose of constructor is initialize the object.
- Evey java class has a Constructor with default type.
- A constructor is is automatically called at the time of object creation.
- a constructor never contain any return-type including voi.
Comments
Post a Comment