using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace ProyectoForEach
{
class MyArray
{
public ArrayList palabras;
public MyArray(){
palabras = new ArrayList();
palabras.Add("foo");
palabras.Add("bar");
palabras.Add("baz");
}
}
class AplicacionForEach
{
static void Main(string[] args)
{
MyArray a1 = new MyArray();
//for (int i = 0; i < a1.palabras.Count; i++)
foreach (string palab in a1.palabras)
{
Console.WriteLine("{0}",palab);
}
Console.ReadLine();
}
}
}
No hay comentarios:
Publicar un comentario
*Dejanos Tus Comentarios*