I\'d like to have an object that implements both the Map and the List interfaces in Java. The idea is similar to the problem in this question: Java Ordered Map
I wan
It should be pointed out that the reason for the error is that Map
contains the definition for the following remove
method:
V remove(Object key)
While List
defines:
boolean remove(Object o)
And, in Java, methods cannot be overloaded based on their return type, so they are conflicting signatures, and cannot be implemented in the same class.