예제 #1
0
 static void Main()
 {
     CustomArrayList shoppingList = new CustomArrayList();
     shoppingList.Add("Milk");
     shoppingList.Add("Honey");
     shoppingList.Add("Olives");
     shoppingList.Add("Beer");
     shoppingList.Remove("Olives");
     Console.WriteLine("We need to buy:");
     for (int i = 0; i < shoppingList.Count; i++)
     {
         Console.WriteLine(shoppingList[i]);
     }
     Console.WriteLine("Do we have to buy Bread? " +
         shoppingList.Contains("Bread"));
 }
예제 #2
0
        static void Main(string[] args)
        {
            CustomArrayList shopingList = new CustomArrayList();

            shopingList.Add("Tomato");
            shopingList.Add("Bread");
            shopingList.Add("Cheese");
            shopingList.Add("Cucumbers");
            shopingList.Add("Beer");
            shopingList.Add(7);
            shopingList.Add("Coke");

            for (int i = 0; i < shopingList.Count; i++)
            {
                Console.WriteLine(shopingList[i]);
            }
            Console.WriteLine(shopingList.Contains("Beer"));
        }