~/ learn/ comp-308/ cards/ Classes, constructors, static & initialization order
1 of 7

Type a constructor that delegates to another with this(...)

Type a constructor that delegates to another with this(...)

Answer

Point() { this(0, 0); }

this(0, 0) calls the two-arg constructor. A this(...) call must be the first statement in the constructor.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/61155635-6595-4905-a14e-b83eff83d95a/flashcard utf-8 LF