ArrayList is a replacement of vector class, It is a new class used to store multiple objects.
In ArrayList the data is organizing in the form of cells. Cell values are storing in heap memory and cell address are storing in associative memory.
Points to Remember
- ArrayList class is not Synchronized.
- ArrayList class elements can be access randomly.
- In the ArrayList value will be stored in the same order as inserted.
- ArrayList class uses a dynamic array for storing the elements.It extends AbstractList class and implements List interface.
- ArrayList class can contain duplicate elements.
- ArrayList allows random access because array works at the index basis.
Note: ArrayList calss contains same methods like vector.
Creating ArrayList is nothing but creating an object of ArrayList class.
Advantages of ArrayList
- ArrayList based applications takes less memory space.
- Retrieving the data from ArrayList will take less time.
- Performance of ArrayList based applications is more.
Syntax :
ArrayList al = new ArrayList();
Program:
import java.util.Arraylist; class DemoArraylist { public static void main(String args[]) { ArrayListOutput:
10 20 30- Progamming is what actually means ?
- What is software development ?
- How we categorized software development in different manner.
C Programming
C Plus Plus
Python
Java Development
Web Designing
Javascript
Mysql
Oracle
C Plus Plus
Python
Java Development
Web Designing
Javascript
Mysql
Oracle
We cover all the programming concepts in various programming languages, this tutorials are very help full for bigener as well as Experience developer, for the ease of understanding we categorized programming in different manner likewise.