How do I convert an array into a collection object?

Share:

To convert array based data into list / collection based we can use java.util.Arrays class. This class provide a static method asList(Object[] a) that converts array into list / collection.

The result of our code is: