Lists in java
Lists in java:
What is a list?
A list is collection of data.For a real time example consider a list of groceries for a month.You can add,remove,clear,get items from a list.List is actually an interface.
There are several lists collections available in java:
What is a list?
A list is collection of data.For a real time example consider a list of groceries for a month.You can add,remove,clear,get items from a list.List is actually an interface.
There are several lists collections available in java:
- Array list:Most important and useful type of list
- LinkedList:Similiar to arraylist with limited functionality
- Vector:Similiar to arraylist but it is synchronised class.
- Stack:LIFO(Last in first out) collection
- add(Object e),add(int index,Object e):adds an element(duh :<).For adding element at specific position pass parameter index.
- remove(int index):remove an element at position
- clear():clears out the list.Make list empty.
Comments
Post a Comment