+ 4

Do LinkedLists always need to be set as an empty list?

Are LinkedLists always set up as empty lists that must have items appended or can a list be set up with contents? If possible, could you provide an example of the latter?

28th Feb 2018, 4:05 AM
Ares
Ares - avatar
1 Odpowiedź
+ 6
Don't know about LinkedList but you can do this List l = Arrays.asList(1,2,4); Note: java.util.Arrays java.util.List are imported
28th Feb 2018, 9:04 AM
David Akhihiero
David Akhihiero - avatar