Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

Give two reasons why you might need to overload a class's constructor in a computer program.

Give two reasons why you might need to overload a class's constructor in a computer program.

Answers


Davis
One reason of overloading a constructor is to provide flexibility, allowing you to choose the most appropriate constructor in the specific instance.
Another is to allow both initialized an uninitialized objects to be declared.you might want to overload a constructor so that dynamic arrays can be allocated.
Githiari answered the question on February 4, 2018 at 12:55

Answer Attachments

Exams With Marking Schemes

Related Questions