Example
Display the value of an item in a list.
|
The get() method retrieves the item located at a specified position within the list.
public |
T denotes the data type of elements in the list.
Parameter |
Description |
index |
Mandatory. Indicates the position of the item in the list. |
Returns: |
The item located at the designated position. |
Throws: |
IndexOutOfBoundsException occurs if the index is negative, equal to the size of the list, or exceeds the list’s size.
|