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
Is array dynamic in java?
Can we declare a constructor as final?
Is java util regex pattern thread safe?
How do you remove all elements from an arraylist in java?
Can we have any code between try and catch blocks?
Can a source file contain more than one class declaration?
What are the characteristics of Final,Finally and Finalize keywords.
What is lazy initialization in java?
In which language java is written?
What is the use of bufferedreader?
What is the purpose of return statement?
explain what is transient variable in java?
What is the use of http-tunneling in rmi?
How much is a java license?
Tell me the Importent classes in net package?