Home
About Us
Contact Us
Bookmark
Saved Bookmarks
Current Affairs
General Knowledge
Chemical Engineering
UPSEE
BSNL
ISRO
BITSAT
Amazon
ORACLE
Verbal Ability
→
Java Collections Tutorial
→
Java Collections Interview Questions in Java Collections Tutorial
→
Difference Between Array And Arraylist In Java?
1.
Difference Between Array And Arraylist In Java?
Answer»
ARRAY
is fixed in size which is provided at the time of creating an Array. ArrayList grows
DYNAMICALLY
and also known as dynamically growing array.
Array can store
PRIMITIVE
types as well as objects. In ArrayList only Objects can be stored.
Arrays can be multi-dimensional whereas ArrayList is always unidimensional.
As Exp. a two dimensional array can be created as -
Integer
MYARRAY
[][] = new Integer[4][
3
];
Performance wise both Array and ArrayList are almost same as internally ArrayList also uses an Array. But there is overhead of resizing the array and copying the elements to the new Array in case of ArrayList.
Show Answer
Discussion
No Comment Found
Post Comment
Related InterviewSolutions
What Is Linkedhashset?
Which Set Implementation Should Be Used If You Want The Insertion Order To Be Maintained?
How Does Hashset Internally Works In Java?
Hashmap Vs Linkedhashmap Vs Treemap In Java?
Difference Between Hashmap And Hashtable In Java?
What Is A Identityhashmap?
What Is A Weakhashmap?
What Is Treemap In Java?
Which Map Implementation Should Be Used If You Want Map Values To Be Sorted By Keys?
What Is Linkedhashmap?
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies