关于接口的问题
假如有两个接口IBase1,IBase2:
interface IBase1
{
void hello();
}
interface IBase2
{
void hello()
}
Test类实现了这两个接口,
public class Test implements IBase1,IBase2
Test怎么样显式的分别实现IBase1和IBase2的hello()方法,以至下面的代码分别调用IBase1和IBase2的hello()的具体实现?
Test t = new Test();
IBase1 ib1;
IBase2 ib2;
ib1 = (IBase1)t;
ib2 = (IBase2)t;
ib1.hello();
ib2.hello();
谢谢!