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
What is wrapper class html?
Can a class be a super class and a sub-class at the same time? Give example.
Difference between final and effectively final ? Why is effectively final even required ?
What is an anonymous class in java?
How many bytes is a string java?
Can a singleton class be inherited?
Explain public static void main(string args[]) in java.
What is the biggest integer?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
what is a green thread? : Java thread
I want to persist data of objects for later use. What’s the best approach to do so?
What is anagram in java?
What are the advantages of defining packages in java?
How is string immutable in java?
What is the list interface in java programming?