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
How to perform binary search in java?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
What is multi level inheritance in java?
What is the purpose of checked and unchecked exceptions in JAVA?
How do you control extraneous variables?
Explain importance of throws keyword in java?
What does math floor () do?
How use .contains in java?
What is difference between java and java ee?
what are synchronized methods and synchronized statements? : Java thread
What is the purpose of an interface?
What is casting in java programming?
Can we use this () and super () in a method?
Explain what pure virtual function is?
Explain try and catch keywords in java?