Wrap All Primitives and Strings
A raw int or string has no domain meaning — wrapping it in a class like Money or Email lets the compiler enforce intent and gives behavior a natural home.
Why this matters
A bare int called age has no constraints — nothing prevents you from passing -5 or 999. A tiny Age class validates itself at construction, carries its own rules, and can't be confused with an unrelated integer like a quantity or a price. You get type safety, a single place for validation, and meaningful names everywhere.
Code Challenge
Study the messy code, try to refactor it, then reveal the clean version.
💡Key takeaway
If a primitive has a business rule attached to it (a range, a format, a unit), wrap it. Invalid values become impossible to construct — you stop defending everywhere and start trusting your types.
🔧 Some exercises may still have errors. If something seems wrong, use the Feedback button (bottom-right of the page) to report it — it helps us fix it fast.
Hint: If you can pass 'banana' as a currency without compile error, you have a primitive obsession problem.
✗ Your version