私はC#プログラミングに不慣れで、それがアマチュアの質問であることを知っているので、私を笑わないでください!
私はこれらのインターフェースを宣言しました
class derived : iInterface3
{
double[] d = new double[5];
public override int MyProperty
{
get
{
return 5;
}
set
{
throw new Exception();
}
}
int iProperty
{
get
{
return 5;
}
}
double this[int x]
{
set
{
d[x] = value;
}
}
}
class derived2 : derived
{
}
interface iInterface
{
int iProperty
{
get;
}
double this[int x]
{
set;
}
}
interface iInterface2 : iInterface
{ }
interface iInterface3 : iInterface2
{ }
iInterfaceのすべてのメンバーを派生クラスに実装しても、このエラーが発生します。
'final_exam_1.派生'はインターフェイスメンバー'final_exam_1.iInterface.this[int]'を実装していません。'final_exam_1.duced.this [int]'はパブリックではないため、インターフェイスメンバーを実装できません。
この
「final_exam_1.duced」はインターフェースメンバー「final_exam_1.iInterface.iProperty」を実装していません。'final_exam_1.duced.iProperty'はパブリックではないため、インターフェイスメンバーを実装できません。
なぜ?
よろしくお願いします!