Difference between array and arraylist.

Answer Posted / bhavani

ARRAY:collection of same data items.
2.array is always of fixed size.
3.initializing an array is too long,then it results in wastage
of memory in heap.
ARRAYLIST : Collection of different data objects.
2.Dynamic in nature.
3.automatic resizing of the list.
4.methods used is:add,remove,insert,clear,sort,reverse....

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is static and final keyword in java?

570


What is the difference between error and an exception?

562


What does @param args mean in java?

544


Why is it called a string?

557


What is the function of static in java?

535






Can we create constructor in abstract class ?

572


What is an iterator java?

523


What is abstraction in java?

611


how to convert Java project into Maven ?

577


Explain what access modifiers can be used for methods?

562


How do you use compareto method?

523


what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????

1795


What are java packages? What is the significance of packages?

561


How do you add an element to an arraylist in java?

481


What are accessor methods in java?

546