Difference between array and arraylist.

Answer Posted / vibhor

An ArrayList is resizable, where as, an array is not.
ArrayList is a part of the Collection Framework. We can
store any type of objects, and we can deal with only
objects. It is growable. Array is collection of similar
data items. We can have array of primitives or objects. It
is of fixed size. We can have multi dimensional arrays.
Array: can store primitive ArrayList: Stores object only
Array: fix size ArrayList: resizable
Array: can have multi dimensional
Array: lang ArrayList: Collection
framework

Is This Answer Correct ?    98 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the properties class in java programming?

712


Define an abstract class with reference to java.

739


How do you remove duplicates in java?

722


How many bytes is a string java?

716


What is ternary operator? Give an example.

780






What's the purpose of using break in each case of switch statement?

707


What are structs in java?

768


give an example for encapsulation?

742


Explain about main() method in java ?

771


What is autoboxing in java?

790


I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

824


What is ternary operator in java?

791


Why local variables are stored in stack?

676


Explain about anonymous inner classes ?

771


What are kinds of processors?

720