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 a method be overloaded based on different return type but same argument type?

0 Answers  


How do you load an HTML page from an Applet ?

2 Answers  


What do u mean by method and also contructer in java ?

3 Answers  


Difference between abtsract & final

1 Answers   Nous,


From the two, which would be easier to write: synchronization code for ten threads or two threads?

0 Answers  






Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

0 Answers   Amazon,


Where will it be used?

0 Answers  


What is the hashcode () and equals () used for?

0 Answers  


why java does not support unsigned keyword?

1 Answers  


What is a singleton factory?

0 Answers  


How does indexof work?

0 Answers  


what is difference between global methods and local methods?

1 Answers  


Categories