Why fill in, copy (dstList, srcList), shuffle, reverse, rotate the methods of the Collections class to accept only List as an argument?

Is there any clear logic: in the Collections class, the following methods accept only List as an argument

fill, copy (dstList, srcList), shuffle, flip, rotate

These methods can take Queue, Deque as well, for example.

+4
source share
1 answer

, Collection, Collection ( , , reverse shuffle, ) ( , fill nCopies, ).

Queue Dequeue , Collection , , (FIFO LIFO), , , , shuffle, .

LinkedList s, List, Deque, .

+3

Source: https://habr.com/ru/post/1678309/


All Articles