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
What does system out println () do?
What are the restrictions imposed on method overriding?
Why java is not 100% object-oriented?
What is the requirement of thread in java?
How many inner classes can a class have?
What is the difference between the prefix and postfix forms of the ++ operator?
What is size of int in java?
Why spring singleton is not thread safe?
Describe how to implement singleton design pattern in struts.
What is core java used for?
What about main thread in java?
What is finalize method?
What is oop principle in java?
What is better - 'bit-shift a value' or 'multiply by 2'?
What are different data structures in java?