Difference between array and arraylist.
Answer Posted / 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 |
Post New Answer View All Answers
What are the methods used to implement for the key object in the hash map?
Can we create a class inside a class in java?
What is a nested structure?
What is the difference between member variables initialization and assignment in a constructor?
Can a top level class be private or protected?
What is the basic difference between string and stringbuffer object?
What is the base class of all exception classes in java?
Can we have multiple catch block for a try block?
Does java have extension methods?
If I only change the return type, does the method become overloaded?
Which programming language is best in future?
Is class forname reflection?
What does localhost mean?
What is keyword auto for?
Explain spliterator in java8?