我想在Interface中调用StuInformationList<Student>里的3个成员方法,但是加上了using StuInformationList<Student>;后还是有错,是什么原因啊,该怎么改呢????急啊 .........
using System;
using System.Collections.Generic;
using System.Text;
using Student;namespace Student
{
    class StuInformationList<Student>
    {
        #region 字段定义
        
        private int maxsize;
        private Student[] data;
        private int last;        #endregion        #region 索引器        public Student this[int index]
        {
            get
            {
                return data[index];
            }
            set
            {
                data[index] = value;
            }
        }        #endregion         #region 属性定义        public int Maxsize
        {
            get
            {
                return maxsize;
            }
            set
            {
                maxsize = value;
            }
        }        public int Last
        {
            get
            {
                return last;
            }
            set
            {
                last = value;
            }
        }        public Student[] Date
        {
            set
            {
                Student[] date = new Student[maxsize];
            }
        }
        #endregion         #region 构造函数
        public StuInformationList(int size)
        {
            maxsize = size;
            data = new Student[size];
            last = -1;
        }
        #endregion         #region 成员方法        public void SealStuInformation()
        {
            for (int i = 0; i < last; i++)
            {
                Console.WriteLine(data[i]);
            }
        }
        public void Add(Student stu)
        {
            Student s = stu;
            data[++last] = stu;
        }
        public void Insert(int i)
        {
            for (int j = i; i < last; i++)
                data[i - 1] = data[i];
        }
        #endregion 
    }
}

解决方案 »

  1.   


    using System;
    using System.Collections.Generic;
    using System.Text;namespace Student
    {
        public class Student
        {
            #region 字段定义
            //学号
            private string stuNumber;
            //姓名
            private string stuName;
            //性别
            private string stuSex;
            //年龄
            private int stuAge;
            //班级
            private int classNumber;        #endregion         #region 属性的定义        public string StuNumber
            {
                get 
                {
                    return stuNumber;
                }
                set
                {
                    StuNumber = value;
                }
            }        public string StuName
            {
                get
                {
                    return stuName;
                }
                set
                {
                    stuName = value;
                }
            }        public string StuSex
            {
                get
                {
                    return stuSex;
                }
                set
                {
                    stuSex = value;
                }
            }        public int StuAge
            {
                get
                {
                    return stuAge;
                }
                set
                {
                    stuAge = value;
                }
            }        public int ClassNumber
            {
                get
                {
                    return classNumber;
                }
                set
                {
                    classNumber = value;
                }
            }        #endregion         #region 构造函数        public Student()
            { 
                stuNumber=null;
                stuName=null;
                stuSex=null;
                stuAge=0;
                classNumber=0;
            }        public Student(string number ,string name,string sex,int age,int CNumber)
            {
                stuNumber = number;
                stuName = name;
                stuSex = sex;
                stuAge = age;
                classNumber = CNumber;
            }        #endregion    }
    }
      

  2.   

    using System;
    using System.Collections.Generic;
    using System.Text;
    using Student.界面类;namespace Student
    {
        class Program
        {
            static void Main(string[] args)
            {
                Interface n = new Interface();
                n.Parameter = 2;
                n.PrimaryInterface();
               
            }
        }
    }