Advertisements
Advertisements
प्रश्न
Distinguish between Parameterised constructor and Non-Parameterised constructor.
अंतर स्पष्ट करें
उत्तर
S. No. | Parameterised constructor | Non-Parameterised constructor |
1. | Using parametric values supplied when an object is created, it initializes the instance variables. | It initializes an object's instance variables with predetermined values that are easily accessible within it. |
2. | Its parameter list contains formal parameters that define it. | It has an empty argument list when defined. |
3. |
For example,
|
For example,
|
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?