Valizada's blog

Java - how to transform Array to linked list

A simple demo of creating linked list from array

// initialize array with some data
String[] letters = new String[] { "A", "B", "C" };
 
// convert array to LinkedList
LinkedList<String> list = new LinkedList<String>(Arrays.asList(letters));