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 we write two same methods in outer class and innerclass.

1 Answers   3i Infotech,


Can a static method be overridden in java?

0 Answers  


What is the syntax and characteristics of a lambda expression? Explain

0 Answers  


Is arraylist sorted in java?

0 Answers  


Can we create object of static class?

0 Answers  






how to make hashmap object as synchronized object?

2 Answers   BOB Technologies,


What does provide mean construction?

0 Answers  


what is the main difference between string and stringbuffer? can you explain it with program?

2 Answers  


Which containers use a flowlayout as their default layout in java programming?

0 Answers  


What restrictions are placed on method overriding in java programming?

0 Answers  


Name the method of a Container that can be used to cause a container to be laid out and redisplayed?

1 Answers  


What we have to do, when we don't want to implement all methods of an interface?

5 Answers  


Categories