title: Java: extending a class and implementing an interface that have the same method
body: <p>Probably the following cannot be done (I am getting a compilation error: "The inherited method A.doSomthing(int) cannot hide the public abstract method in B"):</p>
  
  <pre><code>public class A {
      int doSomthing(int x) {
          return x;
      }
  }
  
  public interface B {
      int doSomthing(int x);
  }
  
  public class C extends A implements B {
  
      //trying to override doSomthing...
  
      int doSomthing(int x) {
          return doSomthingElse(x);
      }
  }
  </code></pre>
  
  <p>Assuming I am allowed to change neither A nor B, my question is can I somehow define C in such a way that it will inherit from both A and B (suppose that it is required for some framework that C will be both an instance of A and B).</p>
  
  <p>Or if not, how would you work around this?</p>
  
  <p>Thanks!</p>