How to create a class that implements java.util.collections

后端 未结 6 784
深忆病人
深忆病人 2021-02-10 09:46

I am trying to create a class say MyStack that would implement a java.util.collections class. MyStack will override some methods of the collections cl

6条回答
  •  不思量自难忘°
    2021-02-10 10:31

    And one recommendation, if you plan to implement your own collection interface consider extending corresponding abstract class, but not implementing interface itself, cause abstract classes implement methods general to the interface. Look at: AbstractCollection, AbstractSet, AbstractList

提交回复
热议问题