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 is final, finally, finalize?
What is a vector in java?
Can we modify the throws clause of the superclass method while overriding it in the subclass?
What are the different types of inheritance in java?
What do you understand by the bean persistent property?
What is the purpose of file class?
What do you understand by overloading and overriding in java?
How do you create an array in java?
What happens if an exception is throws from an object's destructor?
Which is better singleton or static class?
Is static a keyword in java?
Can we declare the static variables and methods in an abstract class?
Is it possible for yielded thread to get chance for its execution again ?
How variables are stored in memory?
Is string is a data type?