Difference between array and arraylist.
Answers were Sorted based on User's Feedback
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 ? | 373 Yes | 49 No |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What are measurable parameters?
What are the benefits of operations?
What is jit and its use?
Explain importance of finally block in java?
What is the difference between static method and instance method in Java?
0 Answers SwanSoft Technologies,
what is java bean?where can we use it?
Which one will take more memory: an int or integer?
Enlist few advantages of inheritance?
Can we write multiple catch blocks under single try block?
What are pass by reference and pass by value?
Differentiate between the constructors and methods in java?
How does finally block differ from finalize() method?