~/ learn/ java-from-zero/ cards/ Constructor overloading & this()
1 of 4

Type a no-arg constructor that delegates with this()

Type a no-arg constructor that delegates with this()

Answer

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

this(0, 0) calls the two-arg constructor. this(...) must be the first statement — putting any code before it is a compile error.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/8fa37489-d406-4464-b339-c068afe9014a/flashcard utf-8 LF