...
How do I solve name conflict with multiple inheritance.
interface I1 { void f1(); }
interface I2 { int f1(); }
class C1 implements I1, I2 { };
How can I both implemement the I1.f1 and I2.f1 for class C1??
I need to create MyConnection from java.sql.Connection and
javax.xml.XQConnection?
That's not really comparable with your example, is it?
There's no name conflict between the operations in java.sql.Connection and
javax.xml.XQConnection with primitives or void as return types.
There are some other operations, that return interface types that differ.
I haven't delved too deep into it, but I think it could be possible to solve
it, though it would be much work, and it *could* be other unresolvable
issues (name conflicts, etc) down the line...
Just to give an example:
In both java.sql.Connection and javax.xml.XQConnection you have the
operation getMetaData, but which returns different types, DatabaseMetaData
and XQMetaData.
So what do you want to return from that?
Just as you "need" to implement java.sql.Connection and
javax.xml.XQConnection into one class, you now "need" to create a type that
implements both DatabaseMetaData and XQMetaData.
class MyMetaData implements DatabaseMetaData, XQMetaData
{
...
}
....and the implementation for your MyConnection could be...
public class MyConnection implements Connection, XQConnection
{
...
public MyMetaData getMetaData() { ... }
...
}
But as I said, there might be other unresolvable issues further down the
line, as I just took a quick glance on it...
// Bjorn A