المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : مقارنات لجميع الانترفيس لمادة M255



روزة
08-02-2012, 08:17 PM
List , map , set , Array







list


Map


Set


Array

(it`s not interface)


****




Dynamic




Dynamic




Dynamic

Can add or remove element


fixed


Size




yes


Has two types (one for key and another for values).


yes


yes


Homogenous

(same type)




Has index.


Has no indexing.


Has no indexing,

No way of reaching particular item.




Yes, using integer index


Indexable




Ordered

(the way to add element organized).


Unordered collection of

key-value,

(but with the implementation class TreeMap will be ordered).


Unordered

(but with the implementation class TreeSet will be ordered)


ordered


Ordering




allowed


Values could be repeated

but key not.


Not allowed,

None item appear twice.


allowed


Duplication