How do I create a LinkedList?
Category: java.util, viewed: 125 time(s).
A linked list is a fundamental data structure in programming. It can stores data and a references to the next and/or to the previous node. There can be a singly linked list, a doubly linked list and a circularly linked list.
The code below show you how to use the java.util.LinkedList class to create a linked list. In the example we create a LinkedList to store a string object using the add(Object o) method. After create the list we iterate the list and print out the contents.
This program will produce the following output:
Grade: A Grade: B Grade: C Grade: E Grade: F
Can't find what you are looking for? Join our FORUMS and ask some questions!
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!
