class Frame
{
static int X;
static int Y;
static uint Color;
static protected bool Check()
{
return (Coords.GetPixelColor(X, Y) == Color);
}
}
class frameBeginning : Frame
{
static int X = 1;
static int Y = 2;
static int Color = 3;
}
Run Code Online (Sandbox Code Playgroud)
frameBeginning.Check();无法编译,因为Check()其保护级别无法访问.
但为什么,Check()受到保护?
Frame<int, int>[] test = new Frame<int, int>[3] {{2,5},{3,6},{4,7}};
Run Code Online (Sandbox Code Playgroud)
数组初始值设定项只能在变量或字段初始值设定项中使用.请尝试使用新表达式.
怎么可能?