Java Constructor Interview Questions:
1. What are Constructors?
- Constructor is a method which is used to initialize an instance of the class.
2. How does Constructor differ from a normal method?
- Constructor has same name as class name. It doesn't have a return type. Constructor gets invoked only when instance of the object is getting created.
3. Can we invoke one Constructor from another Constructor?
- Yes. Using this keyword.
4. Can we invoke superclass Constructor from Child class?
- Yes. Using super keyword.
Post #2062
1.62K
- ❤ 1