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 do you understand by synchronization?

569


What is replacefirst in java?

546


What is the old name of java?

491


Can static methods access instance variables in java?

544


What is overriding in java?

493






What is the difference between java applets and applications?

537


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

570


What is the java idl system?

557


What is comparable and comparator interface? List their differences

558


Can a class have more than one object?

500


What do you mean by hashing?

624


Can you explain the private protected field modifier?

547


How many types of interfaces are there?

547


What is a Transient Object?

609


Why is sizeof not a function?

520