Skip to main content

Practice · 3 of 5

Constructor delegation

CHALLENGE
Difficulty: beginner+25 XP

Implement the Point nested class: the two-arg constructor stores x and y; the no-arg constructor must call this(0, 0) (delegation, not duplication); both getters return the fields.

Back to lesson: Practice: Design reps