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

List any five features of java?

565


What is the use of default method in interface in java?

551


What is the static method?

569


Why multiple inheritance is not supported by java?

512


Detail discussions on JVM, memory management and garbage collector.

550






Which keyword specify that a variable is effectively final ?

566


Is there a jre for java 11?

551


What is array and arraylist in java?

525


What is difference between hashset and hashmap?

556


Which data type is class in java?

549


Can we increase size of array?

564


define the terminology association.

616


What is the default value of the local variables?

506


Define canvas?

564


Can abstract class have private constructor?

496