Java LinkedList
Java LinkedList
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRA
Java LinkedList
❮ Previous Next ❯
Java LinkedList
In the previous chapter, you learned about the ArrayList class. The LinkedList class is almost identical to the
ArrayList :
Try it Yourself »
The LinkedList class has all of the same methods as the ArrayList class because they both implement the
List interface. This means that you can add items, change items, remove items and clear the list in the same
way.
However, while the ArrayList class and the LinkedList class can be used in the same way, they are built very
Tutorials
differently.
Exercises Services Get Certified Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRA
How the ArrayList works
The ArrayList class has a regular array inside it. When an element is added, it is placed into the array. If the
array is not big enough, a new, larger array is created to replace the old one and the old one is removed.
When To Use
Use an ArrayList for storing and accessing data, and LinkedList to manipulate data.
LinkedList Methods
For many cases, the ArrayList is more efficient as it is common to need access to random items in the list, but
the LinkedList provides several methods to do certain operations more efficiently:
❮ Previous Next ❯
Tutorials Exercises Services Get Certified Sign Up Log in
W3schools Pathfinder
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRA
Track your progress - it's free! Sign Up Log in
ADVERTISEMENT
COLOR PICKER
Tutorials Exercises Services Get Certified Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRA
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Tutorials Exercises Services Get Certified Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRA
CONTACT US
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRA