Question 12
Back to Exercise
What is a compact constructor in a record used for?
- A Creating a copy of the record
- B Validating or normalising the component values before they are assigned to the fields Correct
- C Adding extra fields
- D Making the record mutable
Correct Answer: Option B
It has no parameter list; the fields are assigned automatically at the end.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!