Search Interview Questions
| 3361 questions in repository.|
There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Java - Interview Questions and Answers|
|Ans. Both Arrays and ArrayLists are used to store elements. Elements can be either primitives or objects in case of Arrays, but only objects can be stored in Arraylist. Array is a fixed length data structure while arraylist is variable length collection class. Once created, you cannot change the size of the arrays, but arraylists can dynamically resize itself when needed.Another notable difference between Arrays and Arrayslist is that arary is part of core java programming and array list is part of collection classes|
Sample Code for arrays arraylist
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  array  arraylist  array vs arraylist Asked in 7 Companies basic   frequent|
|If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ?|
|What is the difference between ArrayList and LinkedList ?|
|Difference between Vector and ArrayList ?|
|Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ?|
|Difference between ArrayList and LinkedList ?|
| Is this Polymorphism ?|
Map<String, List<String>> inventoryManagerCountMap = new HashMap<String, ArrayList<String>>();
|What is CopyOnWriteArrayList ?|
|What are the advantages and disadvantages of CopyOnWriteArrayList ?|
|Can we add more elements to an array list that has been marked as final ?|