From my understanding if you implement an interface in java, the methods specified in that interface have to be used by the sub classes implementing the said interface.
All methods have to be implemented for the code to compile, (aside from those with default
implementations in Java 8+), but the implementation doesn't have to do anything functionally useful. Specifically, it:
UnsupportedOperationException
(or similar)The latter approach is often taken in the collection classes - all the methods are still implemented, but some may throw an exception if called at runtime.