Difference between array and arraylist.
Answer Posted / mohammad fazulullah
Array is the object and it stores the object of same type
Eg : Its stores complete integer types or string types
int[] IntArray = new int[3];
string[] StringArray = new StringArray[2];
Arraylist is the collection in which we can store the
objects of any data type.
Eg : Arraylist Arr = new Arraylist()
Arr.Add(13); // Integer Type
Arr.Add(10); // String Type
2 . Arrays has the Fixed Lenght where as the Arraylist
varies the leghth as the objects Added.
Is This Answer Correct ? | 196 Yes | 32 No |
Post New Answer View All Answers
Is java 9 released?
Why does java doesnt suuport unsigned values?
What is stream api in java8?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
What is the difference between a constructor and a method?
Can private class be extended java?
How do you find the maximum number from an array without comparing and sorting?
What is the use of bufferedreader?
How to declare objects of a class ?
Can we force the garbage collection to run?
Difference between nested and inner classes ?
I want to persist data of objects for later use. What’s the best approach to do so?
What are thread local variables?
What is default size of arraylist in java?
Can we use string in the switch case?