我有错误
无法通过嵌套类型“Project.Neuro.Net”访问外部类型“Project.Neuro”的非静态成员
使用这样的代码(简化):
class Neuro
{
public class Net
{
public void SomeMethod()
{
int x = OtherMethod(); // error is here
}
}
public int OtherMethod() // its outside Neuro.Net class
{
return 123;
}
}
我可以将有问题的方法移到 Neuro.Net 类,但我需要在外面使用这个方法。
我是一种客观的编程新手。
提前致谢。