zoukankan      html  css  js  c++  java
  • java collections读书笔记(9)collection框架总览(2)

    框架算法:

    1)collection接口

    add()  Adds an element to the collection.
    addAll()  Adds a collection of elements to the collection.
    clear()  Clears all elements from the collection.
    contains()  Checks if a collection contains an element.
    containsAll()  Checks if a collection contains a collection of elements.
    equals()  Checks for equality with another object.
    hashCode()  Returns the computed hash code for the collection

    isEmpty()  Checks if a collection is empty.
    iterator()  Returns an object from the collection that allows all of the collection's elements to be visited.
    remove()  Clears a specific element from collection.
    removeAll()  Clears a collection of elements from the collection.
    retainAll()  Removes all elements from the collection not in another collection.
    size()  Returns the number of elements in the collection.
    toArray()  Returns the elements of a collection as an array.

    Iterator接口:

    interator接口是collection框架用来代替老的Enumeration接口的。

    提供了在collection中遍历元素的一个标准方式。

    hasNext()  Checks for more elements in the iterator.
    next()  Fetches the next element of the iterator.
    remove() Removes an element from the iterator.

  • 相关阅读:
    开挂的列表与矜持的元组
    烦人的字符串
    好用的for循环与range
    浅谈编码
    流程控制与循环
    基础运算符
    python初识
    python的小介绍
    来自极客标签10款最新设计素材-系列九
    chmod----改变一个或多个文件的存取模式(mode)
  • 原文地址:https://www.cnblogs.com/aomi/p/3141485.html
Copyright © 2011-2022 走看看