Difference between array and arraylist.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is wrapper class html?

688


Can a class be a super class and a sub-class at the same time? Give example.

1120


Difference between final and effectively final ? Why is effectively final even required ?

745


What is an anonymous class in java?

748


How many bytes is a string java?

716






Can a singleton class be inherited?

689


Explain public static void main(string args[]) in java.

702


What is the biggest integer?

778


Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?

836


what is a green thread? : Java thread

771


I want to persist data of objects for later use. What’s the best approach to do so?

678


What is anagram in java?

695


What are the advantages of defining packages in java?

716


How is string immutable in java?

742


What is the list interface in java programming?

766