Difference between array and arraylist.

Answers were Sorted based on User's Feedback



Difference between array and arraylist...

Answer / ravikiran

array is the one which can save similar data typed elements.
And the size is limited.
arraylist is a collection which is capable of saving
different data typed objects,And is growable.

Is This Answer Correct ?    372 Yes 49 No

Difference between array and arraylist...

Answer / mohammad fazulullah

Array is the object and it stores the object of same type

Eg : Its stores complete integer types or string types

int[] IntArray = new int[3];
string[] StringArray = new StringArray[2];

Arraylist is the collection in which we can store the
objects of any data type.

Eg : Arraylist Arr = new Arraylist()
Arr.Add(13); // Integer Type
Arr.Add(10); // String Type

2 . Arrays has the Fixed Lenght where as the Arraylist
varies the leghth as the objects Added.

Is This Answer Correct ?    196 Yes 32 No

Difference between array and arraylist...

Answer / ranganathkini

A java.util.ArrayList has the following characteristics over
an array:

1. Provides a resizable array implementation
2. Implements the java.util.List interface
3. Has a tuning parameter called initialCapacity which
specifies the number of elements the ArrayList can hold
before it has to be resized.

Is This Answer Correct ?    174 Yes 44 No

Difference between array and arraylist...

Answer / vibhor

An ArrayList is resizable, where as, an array is not.
ArrayList is a part of the Collection Framework. We can
store any type of objects, and we can deal with only
objects. It is growable. Array is collection of similar
data items. We can have array of primitives or objects. It
is of fixed size. We can have multi dimensional arrays.
Array: can store primitive ArrayList: Stores object only
Array: fix size ArrayList: resizable
Array: can have multi dimensional
Array: lang ArrayList: Collection
framework

Is This Answer Correct ?    98 Yes 19 No

Difference between array and arraylist...

Answer / suhas

Array: can store primitive ArrayList: Stores object only
Array: fix size ArrayList: resizable
Array: can have multi dimensional
Array: lang ArrayList: Collection
framework

Is This Answer Correct ?    74 Yes 12 No

Difference between array and arraylist...

Answer / sharath

Array is collection of similar
data items.
ArrayList is a utill package its a collection.
Array can store primitive and fixed size.
ArrayList are Stores object only and resizable.

Is This Answer Correct ?    45 Yes 9 No

Difference between array and arraylist...

Answer / karunakar

Array is the collection of values of the same data type
>the variables in an array is called array elements
>Array is a reference type data type
>The array structure in System's Memory

Array list is a class .
when you want to access the elements of an array through its
index value location in an array,use an ArrayList.
The use of the arraylist is an alternative to the use of th
array.
The Methods Of ArrayList class are
1)Add
2)Remove
3)Clear
4)Insert
5)TrimToSize
6)Sort
7)Reverse

Is This Answer Correct ?    47 Yes 12 No

Difference between array and arraylist...

Answer / nagarjunareddy.sannapareddy

array is a collection of similar type of data and the
capacity of array is fixed and it define with in system name
pace
array list it hold different type of data and the capacity
of hairstylist is increase dynamically it define withe in
system.collections name space

Is This Answer Correct ?    29 Yes 10 No

Difference between array and arraylist...

Answer / pooja

ARRAY:
array is a userdefined datatype in almost all languages.
array is able to store only one type of values.
syntax:array a1[10];in c
array a1=new array[10];in c++ &java
that means array can store fixed no of values,ofcourse we
can dynamically allocate memory in java but we can't extend
the size.
ARRAYLIST:
arraylist is not supported in c
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 ?    25 Yes 9 No

Difference between array and arraylist...

Answer / pooja

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 ?    23 Yes 10 No

Post New Answer

More Core Java Interview Questions

Is 0 an even number?

0 Answers  


Can you have an inner class inside a method and what variables can you access?

2 Answers  


What is collections framework?

0 Answers  


Which collection is ordered in java?

0 Answers  


Describe how to implement singleton design pattern in struts.

0 Answers  






Difference between a process and a program?

0 Answers   Infosys,


What is Runtime class and its purpose?

2 Answers  


How do you invoke a method?

0 Answers  


How does final modifier work?

1 Answers   Tech Mahindra,


What is the difference between conversation & casting?

0 Answers  


Where can I find jdk in my computer?

0 Answers  


Which is better list or arraylist in java?

0 Answers  


Categories