Thursday, 22 September 2011

What are the differences between ArrayList and LinkedList? java interview questions....

Answer: 
  • it's is a List implementation backed by a Java array, like Vector class
  •  If there are lots of growth periods, performance degrades as the old array needs to be copied into the new array.
  •  However, random access is very quick as it uses an array index to access.
  • LinkedList, the List implementation is backed by a doubly linked list data structure, allowing easy inserts/deletions anywhere in the structure, but really slow random accesses as the access must start at an end to get to the specific position.

for more answers click here



2 comments:

Sara said...

I am just a newbie and please keep updating questions and answers related to java!!
DEKSI Bandwidth Monitor

admin said...

sure soon we update more....