コード例 #1
0
        static void Main(string[] args)
        {
            MyList <int> myList = new MyList <int> ();

            myList.add(5);
            myList.add(7);
            // int b = myList[0];
            //System.Console.WriteLine(b);
            myList.Print();
            System.Console.WriteLine(myList.Count());
            myList.Clear();
            System.Console.WriteLine(myList.Count());
            myList.add(12);
            myList.add(124);
            System.Console.WriteLine(myList.Count());

            MyList <string> myListStr = new MyList <string>();

            myListStr.add("A");
            myListStr.add("B");
            //string str = myListStr[0];
            System.Console.WriteLine(myListStr["world"] + " " + myListStr["Game"]);
            myListStr.Print();
        }
コード例 #2
0
 public void addCar(string name, DateTime year)
 {
     carName.add(name);
     yearCar.add(year);
 }