title: Not implementing a method from an abstract class (and making it not accessible)
body: <p>I was trying to create some Java classes with some shared methods among them and with some other methods only available for some of those classes (and each of those methods are supposed to be different).</p>
  
  <p>I did some research and I found that I could either develop an <code>Interface</code> with <code>default</code> methods or an <code>abstract</code> class with <code>abstract</code> methods.</p>
  
  <p>My issue is that I would like to make those unimplemented methods not available when using the class. I saw this <a href="https://stackoverflow.com/a/30475351/6671476">answer</a> but I think it is a little bit of overkill to throw an <code>Exception</code> for the unimplemented methods. Below is the code I was testing.</p>
  
  <p><strong>AvailableMethods:</strong></p>
  
  <pre><code>public abstract class AvailableMethods {
  
      // This is the shared method
      void methodOne(){
          System.out.println("Common method implementation");
      }
  
      // This should always be implemented and have always different logic
      abstract int methodTwo();
  
      /* This should be only implemented in some cases and when not 
         implemented it should not be visible while using the class */
      abstract String methodThree();
  
  }
  </code></pre>
  
  <p><strong>ClassA:</strong></p>
  
  <pre><code>public class ClassA extends AvailableMethods {
  
      @Override
      public int methodTwo() {
          return 123;
      }
  
      @Override
      public String methodThree() {
          return "test";
      }
  }
  </code></pre>
  
  <p><strong>ClassB:</strong></p>
  
  <pre><code>public class ClassB extends AvailableMethods {
      @Override
      public int methodTwo() {
          return 456;
      }
  
      // I was trying to get rid of this implementation without defining a default value
      @Override
      public String methodThree() {
          return null;
      }
  }
  </code></pre>
  
  <p><strong>Test:</strong></p>
  
  <pre><code>public class Test {
  
      public static void main(String[] args){
          ClassA a = new ClassA();
          ClassB b = new ClassB();
  
          b.methodOne();
          b.methodTwo();
      }
  
  }
  </code></pre>
  
  <p>Basically what I wanted to achieve was when typing <code>b.</code> in my IDE the <code>methodThree</code> not being suggested/available.</p>
  
  <p>I don't know if it is that possible. I have also tried with <code>default</code> interface methods without success. I am not sure if it is a hierarchic issue (maybe I should implement different classes and extend ones from others limiting the visibility of the methods) but it seems a little odd to me not existing a way of doing this without too much classes/interfaces.</p>