Difference between array and arraylist.
Answers were Sorted based on User's Feedback
Answer / vinod agarwal
Array:array is the one which can save similar data typed
elements.
And the size is limited.
Arraylist: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 ? | 3 Yes | 1 No |
Answer / brijendra kumar soni(xavient)
Array is the Coolection of similar type of object.the size
of array is fixed while Array list is the collection of
different data types and the size of array list is growable.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / sakshi jauhari
Arraylist is written as
ArrayList<String> arr= new ArrayList<String>();
whereas array is specified for a single data type object
only like..
int[] ar = new int[6];
Arraylist can be specified for any data type object that it
can store.
its range can also be resized which is not possible in
array.
Is This Answer Correct ? | 2 Yes | 1 No |
can we write two same methods in outer class and innerclass.
Can a static method be overridden in java?
What is the syntax and characteristics of a lambda expression? Explain
Is arraylist sorted in java?
Can we create object of static class?
how to make hashmap object as synchronized object?
What does provide mean construction?
what is the main difference between string and stringbuffer? can you explain it with program?
Which containers use a flowlayout as their default layout in java programming?
What restrictions are placed on method overriding in java programming?
Name the method of a Container that can be used to cause a container to be laid out and redisplayed?
What we have to do, when we don't want to implement all methods of an interface?