Linked List reverese program

Answer Posted / dsr

import java.util.Collections;
import java.util.LinkedList;


public class LikedListDemo {
public static void main(String[] args) {
LinkedList list = new LinkedList();
list.add("Raju");
list.add("Gopal");
list.add("Senthil");
list.add("nagesh");
System.out.println("list size....."+list.size());
System.out.println("list ....."+list);
Collections.reverse(list);
System.out.println("revese list ....."+list);
}
}

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you stop a thread in java?

841


What are meta-annotations?

754


What is java regex?

774


What is the generic function?

759


What are the advantages of compiled language?

842


Can we access the non-final local variable, inside the local inner class?

795


Is nan false?

752


What are the types of methodology?

796


What is the difference between equals() and == in java?

735


Name and explain the types of ways which are used to pass arguments in any function in java.

848


Can a class be protected in java?

752


Can you start a thread twice in Java?

881


How do you implement tree mirroring in java?

830


Is there a jre for java 11?

845


What is ide with example?

745