Вы находитесь на странице: 1из 1

List:

>It�s a child Interface of Collection


>Duplicate is allowed
>Insertion Order is preserved

We can preserve insertion order by using Indez, hence index pays an very important
role in List Interface
Add(int 0,Object o)
addAll(int index, Collection c)
get(int index);
set(int index, Object new)

ArrayList:
1) Growable Array or Resizable Array
2) Duplicate Elements or Objects are allowed
3) Insertion Order is preserved
4) Heterogenous Object(int,String,(int+string))
5) Null insertion is possible
What we need to choose Array or ArrayList?
If you know the size ? go for Array
Why?

Вам также может понравиться