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 string immutability?

637


What is the exact difference in between Unicast and Multicast object?

1620


Why we used vector class?

725


Why is java not 100% pure oops?

716


What happens if I remove static from main method?

634






Is linked list a linear or non-linear data structure?

636


What is string and its types?

721


Give a brief description of java socket programming?

636


What is vector?

673


How will you reverse a singly-link list?

692


What is meant by call by reference?

602


Is finalize() similar to a destructor?

643


Which class represents the socket that both the client and server use to communicate with each other?

664


Can a constructor be made final?

759


What is the use of beaninfo?

682