title: How to implement only required method in interface using Java
body: <p>I have an interface with three methods and I have implemented the two methods in my subclass.</p>
  
  <p>During this, I faced a compile time error.</p>
  
  <p>How do I handle this situation?</p>
  
  <p>Snippet One:</p>
  
  <pre><code>package com.college.problems;
  
  public interface MethodDefination {
  
      void methodOne();
      void methodTwo();
      void methodThree();        
  }
  </code></pre>
  
  <p>Snippet Two: </p>
  
  <pre><code>package com.college.problems;
  
  public class MethodImplementation implements MethodDefination {          
  
      @Override
      public void methodTwo() {
          System.out.println("Tested");
      }
  
      @Override
      public void methodThree() {
  
          throw new UnsupportedOperationException("MethodDefination.methodThree()");
      }
  
      public static void main (String args[]){
          MethodImplementation m = new MethodImplementation();
          m.methodTwo();
      }
  }
  </code></pre>
  
  <p><br/>Note: I don't want to implement all the methods that are required by the interface.</p>