小编Ivv*_*van的帖子

C#使用函数将值添加到列表

哦,是的,它的大脑时间很大。

这里是一些情况:我目前正忙于为学校作业进行简单的学生管理。我目前正在添加将学生添加到班级的选项。我为此使用的代码是这样的:

class Student
{
    //alle properties van de student
    public string studentnummer { get; set; } //student number
    public string naam { get; set; } //name of the student
    public string postcode { get; set; } //adres of the student
    public string telefoonnummer { get; set; } //phone number og the student

    //an constructor
    public Student(string studentnummer1, string naam1, string postcode1, string telefoonnummer1)
    {
        studentnummer = studentnummer1;
        naam = naam1;
        postcode = postcode1;
        telefoonnummer = telefoonnummer1;
    }

    //To string …
Run Code Online (Sandbox Code Playgroud)

c#

2
推荐指数
1
解决办法
73
查看次数

标签 统计

c# ×1