【发布时间】:2012-04-21 16:16:23
【问题描述】:
下面的代码是用 C# 编写的,我使用的是 Visual Studio 2010。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
namespace FrontEnd
{
class Flow
{
long i;
private int x,y;
public int X
{
get;set;
}
public int Y
{
get;set;
}
private void Flow()
{
X = x;
Y = y;
}
public void NaturalNumbers(int x, int y)
{
for (i = 0; i < 9999; i++)
{
Console.WriteLine(i);
}
MessageBox.Show("done");
}
}
}
当我编译上面的代码时,我得到了这个错误:
错误:'Flow':成员名称不能与其封闭类型相同
为什么?我该如何解决这个问题?
【问题讨论】:
标签: c#