Ошибка при создании коллекции "Student" - C#
Формулировка задачи:
Ошибка показана на скрине, как исправить не пойму, кто может подсказать?
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Colec
{
class myColec
{
public void SozdCol()
{
var theStudents = new List<Student>
{
new Student() { Name="Tadpole", Stip=400},
new Student() { Name="Pinwheel", Stip=25},
new Student() { Name="Milky Way", Stip=0},
new Student() { Name="Andromeda", Stip=3}
};
foreach (Student Smb in theStudents)
{
Console.WriteLine(Smb.Name + " " + Smb.Stip);
}
}
}
}Решение задачи: «Ошибка при создании коллекции "Student"»
textual
Листинг программы
using System;
using System.Collections.Generic;
namespace Colec
{
class myColec
{
public void SozdCol()
{
var theStudents = new List<Student>
{
new Student() { Name="Tadpole", Stip=400},
new Student() { Name="Pinwheel", Stip=25},
new Student() { Name="Milky Way", Stip=0},
new Student() { Name="Andromeda", Stip=3}
};
foreach (Student Smb in theStudents)
{
Console.WriteLine(Smb.Name + " " + Smb.Stip);
}
}
static void Main()
{
new myColec().SozdCol();
Console.ReadKey();
}
}
class Student
{
public string Name { get; set; }
public int Stip { get; set; }
}
}