Dispatch function call to other class with same interface in Java
<p>I have two classes A and B which both implment the interface Z. Now, class A should for some functions of Interface Z (Z.f1, Z.f2, Z.f3, ...) only work as dispatcher to an object of class B.</p>

<pre><code>public class A implements Z{

private B b;  //instantiated in constructor of A

@Override
public String f1(int p)
{
  return b.f1(p);
}
...
</code></pre>

<p>Is there a generic way to do this in Java?</p>
