Skip to main content

Practice · 2 of 2

explicit Guards Implicit Conversions

CHALLENGE
Difficulty: advanced+25 XP

The starter's Meters(int) allows accidental implicit conversions like Meters m = 42;. Mark the constructor explicit (keep the user-defined literal working) so the tests prove conversions require intent.

Back to lesson: Practice: Initialization Traps