Java programming collections

21 162 0
Java programming collections

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Java Programming II Collections Java Programming II Contents Collections Framework  Collections of Objects  Iterable and Iterator  Comparable and Comparator  The Legacy Collection Types  Java Programming II Collections      Collections are holders that let you store and organize objects in useful ways for efficient access In the package java.util, there are interfaces and classes that provide a generic collection framework The Collections interfaces: Collection, Set, SortedSet, List, Queue, Map, SortedMap, Iterator, ListIterator, Iterable Some useful implementations of the interfaces: HashSet, TreeSet, ArrayList, LinkedList, HashMap, TreeMap, WeakHashMap Exception Convetions:      UnsupportedOperationException ClassCastException IllegalArgumentException NoSuchElementException NullPointerException Java Programming II Type Trees for Collections Set SortedSet Iterable Iterator Collection ListIerator Queue EnumSet List ArrayList PriorityQueue HashSet LinkedList TreeSet LinkedHashSet Map EnumMap WeakHashMap SortedMap HashMap TreeMap LinkedHashMap Java Programming II The Collection Interface  The Collection Interface    The basis of much of the collection system is the Collection interface   public boolean removeAll(Collection coll) public boolean retainAll(Collection coll) public void clear() Methods:           public int size() public boolean isEmpty() public boolean contains(Object elem) public Iterator iterator() public Object[] toArray() public T[] toArray(T[] dest) public boolean add(E elem) public boolean remove(Object elem) public boolean containsAll(Collection coll) public boolean addAll(Collection

Ngày đăng: 27/10/2017, 11:10

Mục lục

  • Slide 1

  • Slide 2

  • Slide 3

  • Slide 4

  • Slide 5

  • Slide 6

  • Slide 7

  • Slide 8

  • Slide 9

  • Slide 10

  • Slide 11

  • Slide 12

  • Slide 13

  • Slide 14

  • Slide 15

  • Slide 16

  • Slide 17

  • Slide 18

  • Slide 19

  • Slide 20

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan