-, .
-.
, - " ", .
, .
, , API, , , .
, - lastAdded. , hashmap, put lastAdded.
removeLast().
, ( , ). , , ( ).
( OO-).
, , hashmap, . , , , - , , .
OO ( ), , . , , " ", TRIVIAL , , - "" lastItems - , , 2- .
If you do not create this wrapper class, in different places each will have code to set "lastAdded" when they add code to the hash table. Each of these places needs to be changed, some of them may be in other classes requiring you to pass a new column using a hash table. It will be easier to get them out of sync if you forget to change one location.
source
share