欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > > 文章正文

C#控制台基础 用for循环遍历arraylist集合,

来源: javaer 分享于  点击 27846 次 点评:95

C#控制台基础 用for循环遍历arraylist集合,


  1. using System;  
  2. using System.Collections;  
  3. using System.Collections.Generic;  
  4. using System.Linq;  
  5. using System.Text;  
  6. using System.Threading.Tasks;  
  7.   
  8. namespace ConsoleApplication1  
  9. {  
  10.     class Program  
  11.     {  
  12.         static void Main(string[] args)  
  13.         {  
  14.             ArrayList list = new ArrayList();  
  15.             list.Add(1);  
  16.             list.Add(3.23);  
  17.             for (int i = 0; i < list.Count; i++)  
  18.             {  
  19.                 Console.WriteLine(list[i]);  
  20.             }  
  21.   
  22.             Console.ReadKey();  
  23.         }  
  24.     }  
  25. }  

相关文章

    暂无相关文章

用户点评