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

后端 未结 6 783
深忆病人
深忆病人 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:25

    Is defining a stack what you really want to achieve? If so, then go ahead and define it without even implementing Collection interface - it will be OK for simple cases. Or use an existing class - java.util.Stack.

提交回复
热议问题