What is the difference between array and arraylist?
what is the difference between arraylist and linkedlist?

Answer Posted / madhu sudana rao

first one:
array is fixed length,arraylist is growing array(means
they have no fixed length , if u add more the size
arraylist size incress and vise versa)
seond one:
if add and remove the elements in the middle takes more
time by using arrylist in that time use linkedlist
arrylist is good for retiveing the elements in specific
position
arraylist is faster than linkedlist for random accesing
of elemnets

Is This Answer Correct ?    20 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the importance of thread scheduler in java?

588


What is the lifetime and scope of a variable?

509


Explain the difference between string, stringbuffer and stringbuilder in java?

549


What happens when you add a double value to a string?

534


What are the advantages of encapsulation in java?

544






What is your platform?s default character encoding and how to know this?

1743


How do you initialize an arraylist in java?

499


What is the purpose of lambda expressions?

576


Can we compare two strings in java?

552


What are the different types of garbage collectors in java?

540


What is the largest data type in java?

502


How many types of gc are there in java?

552


Can a class be protected in java?

491


Why do we need wrapper class?

529


How do you bind variables?

514