Table of Content

How to create list using an Array in Java ?


Declaration :

Explanation :

Purpose The java.util.Arrays.asList(T… a) returns a fixed-size list backed by the specified array. (Changes to the returned list “write through” to the array.) This method acts as bridge between array-based and collection-based APIs
Parameters a ===> This is the array by which the list will be backed.
Return Value This method returns a list view of the specified array.
Exception NA

Java Program : Example

Below example will explain java.util.Arrays.asList() method.

Output of Program :