TLDR
If you are given an interface, then you have no choice. The creator of the interface forces you to implement all of its methods.
If you are writing an interface, then you are probably mistaken. If you want to implement only a subset of the methods, then you are probably better off using an abstract class.
In detail
The interface declares a behavioral contract. Its purpose is to force all implementing classes to implement all its methods, thus ensuring that the implementing classes conform to the contract.
For example, the following interface:
public interface highlightable { public void highlight(); }
declares that each implementing class must and will implement the highlight() method. Therefore, as a programmer, knowing that a given class implements a highlightable interface allows you to understand that you can highlight it in some way.
Ideally, a good interface should indicate the purpose of each of its methods as follows:
public interface highlightable { public void highlight(); }
therefore, when the programmer encodes the implementation, it becomes clear what needs to be done.
source share