~/ 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/f18ed4fa-9592-4f37-9968-d0069ddd3033/flashcard utf-8 LF