小编Til*_*čaj的帖子

我无法从基类 c# 访问变量

public class MyClass
{
    public int x;
}
public class MyClass2: MyClass
{
    x=1;    
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试从基类访问变量 x 但我收到一条错误消息,指出名称 x 在当前上下文中不存在。

c# inheritance

-1
推荐指数
1
解决办法
105
查看次数

标签 统计

c# ×1

inheritance ×1