Пример #1
0
        public static void Main_10_2_2()//Main_10_2_2
        {
            MyArray <Student> myArr = new MyArray <Student>();

            myArr.Add(new Student());
            Console.WriteLine(myArr[0]);
            MyArray <CollegeStudent> myArrs = new MyArray <CollegeStudent>();
        }
Пример #2
0
        public static void Main_10_2_3()//Main_10_2_3
        {
            MyArray <Student> myArr = new MyArray <Student>();

            myArr.myData = new Student();
            myArr.ShowInfo();
            //实现更灵活的控制
            myArr.ShowInfo <CollegeStudent>(new CollegeStudent());

            //实现更简洁的方式来调用
            myArr.ShowInfo(new CollegeStudent());
            myArr.ShowInfo("Hello, world.");

            //myArr.ShowInfo<string>("Hello, world.");
        }
Пример #3
0
        public static void Main_10_2_5()//Main_10_2_5
        {
            MyArray <Int32> myIntArr = new MyArray <Int32>();

            myIntArr.Add(123);
        }
Пример #4
0
 public static void Main_10_2_4()//Main_10_2_4
 {
     MyArray <Student> myArr = new MyArray <Student>();
     //myArr.ShowInfo<Student, Student>(new Student(), new Student());
 }