Skip to main content

Practice

Classes, constructors, invariants

intermediate~30 min of coding3 challenges

Design small types: an enforced counter, an explicit-only constructor, member ordering.

Checking your progress…0%

What you will practice

  1. A class with an invariantintermediate
  2. explicit shuts the trapintermediate
  3. Member initialization orderintermediate

Need the concept first? Re-read the lesson.