Hi
In C#:
using System.Windows.Forms;
list<string> students = new list<string>();
void main
{
fillStudentList();
PrintStudents();
}
void PrintStudents()
{
foreach (string s in students)
{
MessageBox.Show(s);
}
}
void fillStudentList()
{
students.Add("John");
students.Add("Jack");
students.Add("Pete");
students.Add("Mario");
}
Hope this was of help!