Merge items from one list into another.
import public
|
The addAll() method appends all items from a collection to the list.
When an index is specified, the new items will be inserted at that position, shifting all subsequent elements in the list forward.
If no index is specified, the new items will be added to the end of the list.
Choose one of the following:
public |
public |
T denotes the data type of items in the list.
Parameter |
Description |
index |
Optional: The position in the list where the item should be added. |
items |
Required: The item that will be added to the list. |
Returns: |
It returns true if the list has been altered, and false otherwise. |
Throws |
IndexOutOfBoundsException occurs if the index is negative or exceeds the list’s size. |
Insert items at a specific position within the list.
import public
|