C#泛型接口

       public interface IList<T>
        {
            T[] GetElements();
        }
        public interface IDictionary<K, V>
        {
            void Add(K key, V value);
        }
       //泛型接口的类型参数要么已实例化,要么来源于实现类声明的类型参数
        class List<T> : IList<T>, IDictionary<int, T>
        {
            public T[] GetElements()
            {
                return;
            }
            public void Add(int index, T value)
            {

            }

        }

posted @ 2008-02-28 15:44  不染丹心  阅读(2012)  评论(0)    收藏  举报