c#写的一个学生管理系统,有错,帮忙改下!

来源:百度知道 编辑:UC知道 时间:2024/06/25 20:05:15

public Student this[int StuId]

这是什么玩意!哪有这么写的?

你要做函数声明也是 public Student(int StuId)
两个错误:1.用了中括号;2.函数声明里面带有系统关键字this。

我改了一下,你看看这样行不?
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace ConsoleApplication4
{
public class Student
{
private int _stuid;
public int Stuid
{
get { return _stuid; }
set { _stuid = value; }
}
private string _name;
public string Name
{
get { return _name; }
set { _name = value; }
}
private int _age;
public int Age
{
get { return _age; }
set { _age = value; }
}
private string _address;
public string Address
{
get { ret