How do I reverse the order of LinkedList elements?
Category: java.util, viewed: 567 time(s).
To reverse the order of LinkedList elements we can use the reverse(List> list) static method of java.util.Collections class. Here is the example:
Here is the output of the program:
Output in original order: ========================= Grade = A Grade = B Grade = C Grade = D Grade = E Grade = F Output in reverse order: ========================= Grade = F Grade = E Grade = D Grade = C Grade = B Grade = A
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!
