public class Garage:IEnumerable
{
Car[] carArray = new Car[4];
//启动时填充一些Car对象
public Garage()
{
carArray[0] = new Car("Rusty", 30);
carArray[1] = new Car("Clunker", 50);
carArray[2] = new Car("Zippy", 30);
carArray[3] = new Car("Fred", 45);
} public IEnumerator GetEnumerator()
{
return this.carArray.GetEnumerator();
}
} 问题:提示我的Car[](未能找到命名空间或类型,是否缺少using引用集)
可是我看他的代码也没有给Car[]新定义一个类啊?那就算是给Car[]新定义一个类,那怎么新定义的这个Car[]类应该怎么写呢?
解决方案 »
- 用C# 如何做一个声控flash
- 如何在不同国家语言下提示不同的MessageBox.Show("")内容?
- vs205不能调试运行
- 分布式事务处理 SQL2005 和DB2数据库
- WinForm编译后exe默认图标是app.ico,怎样使编译后exe文件的图标是my.ico?
- 怎样才能做到:高内聚低耦合
- 很奇怪的问题,为什么只有设置断点更新调试的时候,页面才显示更新内容,否则不显示更新后的内容
- 如何打开文件夹,并选中指定文件?
- webservice问题
- 有关用c#做的windows service的问题~
- listview控件属性FocusedItem与SelectedItems的区别
- 正则处理大的TXT问题
{
public Car(){};
}
{
public string Type { get; set; }
public int Count { get; set; }
}
{
public Car(string type, int count)
{
Type = type;
Count = count;
}
public string Type { get; set; }
public int Count { get; set; }
}