在C#中,观察下列代码,找出错误的行,并修改正确的选项是() ArrayList list = new ArrayList() { }; Customer teng = new Customer(" 马腾 ", 32, " 汕头市 "); Customer yun = new Customer(" 王云 ", 28, " 杭州市 "); Customer si= new Customer(" 李军 ", 25, " 仙桃市 "); list.Add(teng); list.Add(yun); list.Add(si); Console.WriteLine(" 排队等待的客户有:"); for (int i = 0; i < list.Length; i++)//(1) { Console.WriteLine("{0} 号:{1}", i+1, (list[i] as Customer).Name); }
A没有错
B注释(1)处的List.Length改成List.Count
C注释(1)处的List.Length改成List.Count()
D注释(1)处的List.Length改成List.Length()
相关试题
-
在C#中,观察下列代码,找出错误的行,并修改正确的选项是() ArrayList list = new ArrayList() { }; Customer t
-
在C#中,观察下列代码,给出对应的结果(): ArrayList list = new ArrayList() { }; Customer teng = new Cus
-
在C#中,观察下列代码给出最后的结果: ArrayList list = new ArrayList(2); Console.WriteLine(&quot;
-
amp;quot;&lt;br&gt;&quot;+ Number(&quot;&quot;)+&quot;&lt;br&gt;&
-
在C#中,以下代码运行结果依次为() static void Show() { Console.WriteLine(&quot;大家好!&quo