English

Answer the following in brief. Give a program code example wherever applicable. Can constructors be overloaded?

Advertisements
Advertisements

Question

Answer the following in brief. Give a program code example wherever applicable.

Can constructors be overloaded?

Short Answer
Advertisements

Solution

  • 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
  Is there an error in this question or solution?
Chapter 4: Constructors - Exercises [Page 115]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 4 Constructors
Exercises | Q 3. (iv) | Page 115
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×