Advertisements
Advertisements
प्रश्न
Distinguish between Parameterised constructor and Non-Parameterised constructor.
फरक स्पष्ट करा
Advertisements
उत्तर
| 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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
