title: Java Abstract Class Confusion: overridden method not being called
body: <p>So I have two classes.  One is abstract:</p>
  
  <pre><code>public abstract class AbstractClient {
      protected boolean running = true;
  
      protected void run() {
          Scanner scanner = new Scanner(System.in);
          displayOptions();
          while (running) {
              String input = null;
              while (scanner.hasNext()) {
                  input = scanner.next();
              }
              processInputCommand(input);
          }
      }
  
      abstract void displayOptions();
  
      abstract void processInputCommand(String input);
  
  }
  </code></pre>
  
  <p>One is the concrete subclass:</p>
  
  <pre><code>public class BasicClient extends AbstractClient {
      private IBasicServer basicServer;
  
      public static void main(String[] args) {
          new BasicClient();
      }
  
      public BasicClient() {
          try {
              System.setSecurityManager(new RMISecurityManager());
              Registry registry = LocateRegistry.getRegistry();
              basicServer =  (IBasicServer) registry.lookup(IBasicServer.LOOKUPNAME);
              run();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  
      @Override
      void displayOptions() {
          BasicClientOptions.displayOptions();
  
      }
  
      @Override
      void processInputCommand(String input) {
          // TODO Auto-generated method stub
  
      }
  }
  </code></pre>
  
  <p>Now in the subclass I call the run() method of the abstract class because this should be common to all clients.  Inside the run() method is a call to the abstract method displayOptions().  </p>
  
  <p>I have overridden displayOptions() in the subclass so I assumed that it would invoke the subclassed method but it seems it has not.  Is there a way to do this or have I made an obvious mistake or have I misunderstood how abstract classes should work?</p>
  
  <p>P.S I tried putting a print statement inside the subclassed displayOptions() to ensure I hadn't done something daft with method I call.</p>
  
  <p>Many thanks,</p>
  
  <p>Adam</p>