基本クラスとインターフェースがあります。今、これらからサブクラスを作成しています。子クラスのオブジェクトを指すインターフェイス型の参照変数を作成した場合、それを使用して基本クラスのメソッドにアクセスできますか?
Class BaseClass
{
public void baseClassMethod()
{
.....
}
}
Interface MyInterface
{
public void Interfacemethod();
}
Class ChildClass:BaseClass, MyInterface
{
....
}
....
main()
{
MyInterface myclass= new ChildClass ();
myclass.baseClassMethod();//Is this possible? y?
}