Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ArrayList がある場合、Collections.swap(list, indexA, indexB) を使用して 2 つのオブジェクトを交換できます。
ArrayDeque に似たものはありますか?
NoArrayDequeueはDequeue実装です。つまり、コレクションの開始時と終了時にのみ要素を挿入および削除するために使用されることを意味します。要素へのインデックス付きアクセスは提供しません ( とは異なりますList)。
ArrayDequeue
Dequeue
List
要素へのインデックス付きアクセスとスワップ操作が必要な場合は、設計を再検討し、別の Collection タイプを使用する必要があります。