Returns an unmodifiable list containing an arbitrary number of elements. See Unmodifiable Lists for details.
| the |
|the elements to be contained in the list|
List containing the specified elements
| if an element is |
@apiNote This method also accepts a single array as an argument. The element type of the resulting list will be the component type of the array, and the size of the list will be equal to the length of the array. To create a list with a single element that is an array, do the following:
This will cause the
String array = ... ; List<String> list = List.<String>of(array);
List.of(E)method to be invoked instead.