CS3101-3 Programming Language-JAVA Fall 2004 Oct.13rd
CS3101-3 Programming Language - JAVA Fall 2004 Oct.13rd
Roadmap today ●Review ●Inner class ●Multi--threading ●Graphics
Roadmap today lReview lInner class lMulti-threading lGraphics
Containers O Hold a group of objects o Significantly increase your programming power OAll perform bound checking ● array:efficient,can hold primitives Collection:a group of individual elements OList,Set o Map:a group of key-value object pairs OHashMap o Misleading:sometimes the whole container libraries are also called collection classes
Containers l Hold a group of objects l Significantly increase your programming power l All perform bound checking l array: efficient, can hold primitives l Collection: a group of individual elements ¡List, Set l Map: a group of key-value object pairs ¡HashMap l Misleading: sometimes the whole container libraries are also called collection classes
Collection:hold one item at each location List:items in order Set:no duplicates,no ordering ArrayList List LinkedList Vector Collection Preserve the insertion of the elements Set HashSet LinkedHashSet TreeSet
Collection List ArrayList LinkedList Vector Set HashSet LinkedHashSet TreeSet Collection: hold one item at each location List: items in order Set: no duplicates, no ordering Preserve the insertion of the elements
Map:key-value pairs,fast retrieval no duplicate keys,no ordering HashMap LinkedHashMap Map Hashtable Preserve the insertion of the elements TreeMap
Map HashMap LinkedHashMap Hashtable TreeMap Map: key-value pairs, fast retrieval no duplicate keys, no ordering Preserve the insertion of the elements