How do I get the first and the last element of a LinkedList?
Category: java.util, viewed: 555 time(s).
The get the first element we can use the LinkedList.getFirst() method and to get the last element we can use the LinkedList.getLast() method.
The program will print the following result:
First member = Alice Last member = Mallory
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!
