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 the difference between an interface and an abstract class?
How do you reverse a string in java?
What is a void method?
What is a local class in java?
What do you understand by abstract classes?
How do you compare two objects?
What are the 3 types of control structures?
What is super in java?
What does sprintf mean?
What is the exact difference in between Unicast and Multicast object? Where will it be used?
What is unicode datatype?
What technique is carried out to find out if a particular string is empty?
Is it possible to compare various strings with the help of == operator?
What is a class instance variable?
Why we cannot override static method?