![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AbstractSequentialList in Java
The Java Collection Framework contains the AbstractSequentialList class. This class is used to create and implement an unmodifiable list. Also this class implements the Collection interface and the AbstractCollection class.
A program that demonstrates this is given as follows −
Example
import java.util.*; public class Demo { public static void main(String[] args) { AbstractSequentialList<String> list = new LinkedList<>(); list.add("John"); list.add("Martha"); list.add("Sally"); list.add("Susan"); list.add("Harry"); System.out.println("The elements are: " + list); } }
The output of the above program is as follows −
Output
The elements are: [John, Martha, Sally, Susan, Harry]
Now let us understand the above program.
The AbstractSequentialList class implements an unmodifiable list. The list elements are displayed. A code snippet that demonstrates this is given as follows −
AbstractSequentialList<String> list = new LinkedList<>(); list.add("John"); list.add("Martha"); list.add("Sally"); list.add("Susan"); list.add("Harry"); System.out.println("The elements are: " + list);
Advertisements