using System;
namespace Example
{
class Person
{
public Person(string _name, int _age)
{
name = _name;
age = _age;
}
public string name = "";
public int age = 0;
}
class Startup
{
static void Main()
{
Person[] people = {new Person("John", 35),
new Person("Jill", 24),
new Person("Sarah", 29),
new Person("Mary", 28)};
foreach (Person p in people)
{
if (p.age >= 30)
{
Console.WriteLine(p.name);
Console.WriteLine("Press any key to continue. . .");
Console.ReadKey();
}
}
}
}
}