title: How to deal with unused @Override methods?
body: <p>As you know, some methods must be overwritten when implementing interfaces. In my case it happens quite often that I have to overwrite methods that I don't need. As a result, my classes are crammed with empty @Override methods.</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>@Override
  public void keyPressed(KeyEvent ke) {
      // TODO Auto-generated method stub
      if(ke.getKeyCode() == KeyEvent.VK_END) {
          System.exit(0);
      }
  }
  
  @Override
  public void keyReleased(KeyEvent arg0) {}
  
  @Override
  public void keyTyped(KeyEvent arg0) {}
  </code></pre>
  
  <p>In this example, I would like to close my program by pressing the "End" key on the keyboard. As soon as I implement the required "KeyListener" interface, I have to overwrite the methods "keyReleased" and "keyTyped".
  However, since I do not need these two methods, they remain empty in my class.</p>
  
  <p><strong>Example note:</strong></p>
  
  <p>Of course, these 3 lines of code are not a big problem. The implementation of the "MouseListener" interface would look completely different, where almost twice the number would have to be overwritten.
  Not to mention what it would look like when implementing multiple interfaces.</p>
  
  <p><strong>Problem:</strong></p>
  
  <ol>
  <li>Through empty methods, the whole code makes an unclean impression.</li>
  <li>Any confusion when passing the code to third parties.</li>
  <li>In many places it is advised to remove unused code. In my case these empty @Override methods would be unused. (e. g. <a href="https://stackoverflow.com/questions/15699995/why-unused-code-should-be-deleted">here</a>)</li>
  </ol>
  
  <p>What would be the best way to clean up these empty @Override methods and make my code look more "clean"?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Don't get confused by my example. The question itself was about the unused override methods in general and not about the problem in my example. I'm sorry if I've been unclear</p>