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