0
How to convert an array to linked list(implement) in java?
Game entry to display the top 10 scores in array i have an assignment to change it into linked list without using the build-in classes.(implement).
3 Réponses
+ 1
To convert an array into a java.util.LinkedList we can use the java.util.Arrays class’s asList()method. The Arrays class in the java.util package provides a utility method to convert an array to a List. The Arrays.asList() method will convert an array to a fixed size List.
To create a LinkedList, we just need to pass the List to the constructor of the java.util.LinkedList class.
0
yes thank you i know this, but the assignment about creating the linked list not using the utilities.
0
We can convert arary to linkedlist using three ways
1. Arrays.asList()
2. Collections.addAll()
3. add() method
you can see code example here visit -->>https://www.javavogue.com/2015/05/how-convert-array-to-linkedlist.html/