Features of ArrayList over Array in java

 

ArrayArrayList
Add an element at the end of the array
This action is not supported
list.add(s);
Add an element in the middle of the array
This action is not supported
list.add(15, s);
Add an element at the beginning of the array
This action is not supported
list.add(0, s);
Delete an element from the array
We could delete an element with list[3] = null. But this would leave a 'hole' in the array.
list.remove(3);

Comments

  1. If I had the talent you have, I would be happy. It really touched base to me and I am glad I found this material.Thank you very much.amature

    ReplyDelete

Post a Comment

Popular posts from this blog

Java Program to create a large array and copy its values equally to two small arrays and display the second array only

Python program to sum up the Salary when the Name and Age matches with subsequent rows.