A booking program executes the following Java code from top to bottom. Assume Ticket is available and each new Ticket() expression completes successfully, creating one fresh object. Count only the objects created by the expressions shown.
Ticket first = new Ticket(); Ticket second = new Ticket(); Ticket third = first; // Checkpoint A first = second; // Checkpoint B second = new Ticket(); // Checkpoint C third = first; // Checkpoint D
At each checkpoint, enter two exact whole-number counts: the total number of objects created so far, and the number of distinct objects referenced by first, second, and third together. Count an object only once in the second column even if several variables refer to it.
Unlock full course notes by signing up