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

Can you explain the cs option of java interpreter?

0 Answers  


Define canvas?

0 Answers  


Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?

0 Answers  


Explain the difference between association, aggregation and inheritance relationships.

0 Answers  


Why do we use regex?

0 Answers  






What is not thread safe?

0 Answers  


what are different ways in which a thread can enter the waiting state? : Java thread

0 Answers  


Can we overload destructor in java?

0 Answers  


What is the final keyword?

0 Answers  


What is a Presistent Object?

0 Answers   InfoAxon Technologies,


Define inheritance?

0 Answers  


What are the two basic ways in which classes that can be run as threads may be defined?

0 Answers  


Categories