Difference between array and arraylist.

Answers were Sorted based on User's Feedback



Difference between array and arraylist...

Answer / vinod agarwal

Array:array is the one which can save similar data typed
elements.
And the size is limited.

Arraylist:it is also a type of array in which we can extend
size
dynamically.
syntax:
ArrayList ar=new ArrayList();
where ArrayList is a class

Is This Answer Correct ?    3 Yes 1 No

Difference between array and arraylist...

Answer / brijendra kumar soni(xavient)

Array is the Coolection of similar type of object.the size
of array is fixed while Array list is the collection of
different data types and the size of array list is growable.

Is This Answer Correct ?    3 Yes 1 No

Difference between array and arraylist...

Answer / 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

More Core Java Interview Questions

Difference between == and .equals() ?

0 Answers  


Difference between interface and abstract class with ex.

4 Answers   Cognizant, Tech Mahindra,


Are there structures in java?

0 Answers  


What is garbage collection? What is the process that is responsible for doing that in java?

0 Answers  


What is file class and what is its purpose?

1 Answers  






Can inner class extend any class?

0 Answers  


what are Checked & Unchecked exceptions ?

2 Answers  


How can you add and remove nodes in jtree?

0 Answers  


What is the use of object and class classes?

0 Answers  


What is the purpose of nested class in java?

0 Answers  


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

0 Answers  


What is anti pattern in java?

0 Answers  


Categories