QUESTION

Text
Image


20. Recall that the Counter class initializes itself to 0 , and allows a client to increment it. Identify the possible output of the following code sequence: Counter $c=$ new Counter (); c.increment () ; c.increment (); c.increment () ; System, out, Dxint In $(c)$; [1] 0 [2] 1 [3] 2 24. Suppose we start with an empty SortedArray Collection $<$ String $>$ object and add the elements "bat", "ant" "dog" "cat" and "eel" to the collection in that order. The element held in array index 2 will be: [1] "bat" [2] "ant" [3] "dog" [4] "cat" [5] "eel" 25. Our Collection ADT supports: [1] retrieval by priority: [2] storage of null elements. [3] first in first out access. [4] retrieving an element based on its key.

Public Answer

WZTCX8 The First Answerer