posted 21 years ago
I was reading through chapter 11 on the Collections framework and found this error that is illustrated by an inconsistency between the venn diagram on p.328 and review question #11.11:
I think this must be a mistake--it's suggested that the Collection.addAll() method operates according to the union principle:
{1,3,2}U{1,3,2} = {1,3,2}
but evidently this is not the case as the example
shows.
If addAll() operated according to set union principle than the call to subList(2,5) on line 12 would produce IndexOutOfBoundsException.
I wonder if anyone can corroborate whether or not my assumption is correct?