我是正在学习的学生c#,当我执行程序时遇到错误.
On console:我期待看到字符串'Harry'.
错误:'ConsoleApplication1.Student'不包含带有1个参数的构造函数
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Student student = new Student("Harry");
System.Console.WriteLine(student.ToString());
System.Console.ReadLine();
}
}
class Student
{
public string Name { get; set; }
}
}
Run Code Online (Sandbox Code Playgroud)
问题:如何解决该计划?请有人指导我.
c# ×1