~/ learn/ comp-308/ cards/ The Collections framework map
1 of 5

Declare to the interface, instantiate the implementation

Declare to the interface, instantiate the implementation

Answer

List<Event> events = new ArrayList<>();

The variable type is the List interface; only the right side names the concrete ArrayList. The diamond <> infers <Event> from the declaration. This decouples every method using `events` from the implementation — the exact idiom the Greenhouse Controller uses.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/f18ed4fa-9592-4f37-9968-d0069ddd3033/flashcard utf-8 LF