6.d Create a List of Longs. Create an array that "backs" the List. Change a value in the List and display the contents of the array. Change a value in the array and display the contents of the List. Attempt to add a new entry to the List.

I believe that I was able to create a List that backs an array by using the asList() method, but I don't know how to create an array that backs a list.

Thanks for reading my post.

-- Kaydell

Post by:dennis deems
,
Ranch Hand

Oct 17, 2011 14:20:33

It just means to create the List of Longs by creating a Long[] array and then using Arrays.asList.

The first lines of Arrays.asList javadoc:

Returns a fixed-size list backed by the specified array. (Changes to the returned list "write through" to the array.)

This thread has been viewed 967 times.

All times above are in ranch (not your local) time.
The current ranch time is Dec 19, 2018 00:41:20.