profit
❔ How would you index this or access anything in this List?
I'm new and trying to learn more advanced lists. i found this code on a learning forum and I think its pretty neat, and i want to learn more about how to work with it!
Ive been trying to figure out how to index it and thats where im running into problems. I've looked up just about every keyword i can think of and nothing is working or it just returns namespace.Student 😭 I would really appreciate if someone could help or explain!
Ive been trying to figure out how to index it and thats where im running into problems. I've looked up just about every keyword i can think of and nothing is working or it just returns namespace.Student 😭 I would really appreciate if someone could help or explain!
class Student
{
public int Id ;
public string Name;
}
class ProgramMain
{
static void Main(string[] args)
{
var students = new List<Student>()
{
new Student(){ Id = 1, Name="Bill"},
new Student(){ Id = 2, Name="Steve"},
};
}
}
}
(If having the link to the page i found it on would help here it is https://www.tutorialsteacher.com/csharp/csharp-list)17 replies