Problem Statement
What is the purpose of a parameterised constructor?
Explanation
A parameterised constructor allows you to supply initial values for the object’s fields at the time of creation. This helps set up the object in the correct state from the outset and avoid separate setter calls afterwards.
Practice Sets
This question appears in the following practice sets: