title: Java dynamic proxy confusion
body: <p>Is it possible to have an interface(A) extend another interface(B) and use the methods of the class that implemented the interface(B) ? Is this what dynamic proxy is all about?</p>
  
  <p>Say we have</p>
  
  <pre><code>public interface A {
      String getMessage();
  }
  
  public class AImpl implements A{
      String msg = "Hello World";
  
      @Override
      String getMessage(){
          return this.msg;
      }
  }
  
  public interface B extends A {
  }
  
  public class main {
  
     B b;
     public main(B b){
        this.b = new B();
     } 
  
     System.out.println(b.getMessage()); // prints "Hello World"
  }
  </code></pre>