title: How to access method in base class from child class in java
body: <p>How to access parent class's methods from child class? Following is my class implementation:</p>
  
  <pre><code>public interface BaseUrl {
      public String getNameSpace();
      public String getUrl();
  }
  </code></pre>
  
  <p>BaseSoapUrl  Class:</p>
  
  <pre><code>public class BaseSoapUrl implements BaseUrl {
  
      @Override
      public String getNameSpace() {
          return "https://host.com/AndroidWFC/";
      }
  
      @Override
      public String getUrl() {
          return "https://host.com/AndroidWFC/MobileWS.asmx";
      }
  }
  </code></pre>
  
  <p>SoapURL Interface:</p>
  
  <pre><code>public interface SoapURL {
      public String getSoapAction();
      public String getMethodName();
  }
  </code></pre>
  
  <p>LoginSoap  Class:</p>
  
  <pre><code>public class LoginSoap extends BaseSoapUrl implements SoapURL {
  
     @Override
      public String getSoapAction() {
          return "https://host.com/AndroidWFC/UserControl";
      }
  
      @Override
      public String getMethodName() {
          return "UserControl";
      }
  }
  </code></pre>
  
  <p>For the sake of simplifying the code i want to implement them like this. earlier it was something like below :</p>
  
  <pre><code>public interface SoapURL {
      public String getNameSpace();
      public String getUrl();
      public String getSoapAction();
      public String getMethodName();
  }
  </code></pre>
  
  <p>LoginSoap  Class:</p>
  
  <pre><code>public class LoginSoap implements SoapURL {
  
     @Override
      public String getNameSpace() {
          return "https://host.com/AndroidWFC/";
      }
  
      @Override
      public String getUrl() {
          return "https://host.com/AndroidWFC/MobileWS.asmx";
      }
     @Override
      public String getSoapAction() {
          return "https://host.com/AndroidWFC/UserControl";
      }
  
      @Override
      public String getMethodName() {
          return "UserControl";
      }
  }
  </code></pre>
  
  <p>and i could access these methods like below :</p>
  
  <pre><code>private SoapURL soapURL = new LoginSoap();
  String static final url = soapURL.getUrl();
  </code></pre>
  
  <p>Now the return values form <code>public String getNameSpace();</code> and <code>public String getUrl();</code> are going to be same in all child classes ; so why to write code again and again. There are going to be many classes which is going to implements SoapURL interface because of web service is being used.</p>
  
  <p>so my question is how to access methods which is in <code>BaseSoapUrl</code> through <code>soapURL</code>?</p>