How is ArrayList implemented in Java…explain whether Doubly linked or Singly linked

Showing Answers 1 - 7 of 7 Answers

We can creat a instance for the Arraylist class using List interface. I thing it's dobully linked list, because we can add the items (elements) at any position, so the Prev.Link and Next.link field indicate the Previous and Next Element in the List.. If the Item is there in first the Prev.Lind field will indicate the last item in the list.

Prabhu

  Was this answer useful?  Yes

praveen

  • Jan 5th, 2007
 

ArrayLists are implemented with an array, and when that array is full and an additional elementis added, a new array is allocated and the elements are copied from the old to the new. Becauseit takes time to create a bigger array and copy theelements from the old array to the new array, it is a fasterto create an ArrayList with a size that it will commonly be when full. Of course, if you knew thefinal size, you could simply use an array. However, for non-critical sections of codeprogrammers typically don't specify an initial size.

  Was this answer useful?  Yes

Guest

  • Jan 9th, 2007
 

it is implemented using an underlying Object[] array

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions