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
What is a conditional statement explain with example?
Can we pass null as argument in java?
Can an interface have a constructor?
Why char array is preferred over string for storing password?
Why parameters should be passed by reference?
Is char * a string?
What are decalarations?
Explain about the performance aspects of core java?
What are implicit objects in java?
What is protected in java?
What is thread life cycle in java?
How use .contains in java?
Can inner class extend any class?
What is a line break example?
What is wrapper class html?