Advertisements
Advertisements
प्रश्न
Answer the following in brief. Give a program code example wherever applicable.
Can constructors be overloaded?
लघु उत्तरीय
Advertisements
उत्तर
- Flexible Object Creation: It allows a class to have multiple constructors with the same name but different sets of parameters (differing in number, data type, or order of arguments).
- Multiple Configurations: It enables you to initialize different objects of the same class in various ways depending on the data available at that moment.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 4: Constructors - Exercises [पृष्ठ ११५]
