Difference between array and arraylist.

Answer Posted / sakshi jauhari

Arraylist is written as
ArrayList<String> arr= new ArrayList<String>();
whereas array is specified for a single data type object
only like..
int[] ar = new int[6];

Arraylist can be specified for any data type object that it
can store.
its range can also be resized which is not possible in
array.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is map java?

603


What is the use of a copy constructor?

656


Explain illegalmonitorstateexception and when it will be thrown?

712


What does system out println () do?

656


Does java isempty check for null?

665






What is ‘is-a ‘ relationship in java?

678


What is space character in java?

668


What is object class in java?

576


Differences between external iteration and internal iteration?

691


Explain a few methods of overloading best practices in java?

615


What is the tradeoff between using an unordered array versus an ordered array?

777


What is meant by collection in java?

649


What is a parameter example?

614


What is the function of static in java?

625


What do you understand by classes in java?

663