• 2022-06-01
    下列( )方法是在Collection接口中定义的。
    A: iterator()
    B: isEmpty()
    C: toArray()
    D: setText()
  • C

    内容

    • 0

      下列接口中,继承了Collection接口的是______。 A: Set B: Map C: Iterator D: AbstractCollection

    • 1

      Collection接口继承自Iterator接口,Iterator接口中的iterator()方法返回一个Iterator实例,它使用()方法来检测迭代器中是否还有更多的元素? A: next() B: hasNext() C: nextElement() D: hasNextElement

    • 2

      所有Collection集合类都必须实现的方法在()接口中定义。 A: List接口 B: Collection接口 C: Set接口 D: Map接口

    • 3

      下列关于LinkedList类的方法,不是从List接口中继承而来的是() A: toArray() B: pop() C: remove() D: isEmpty()

    • 4

      下面哪些方法是Collection接口的? A: clear() B: isEmpty() C: size() D: getSize()