using System.Collections.Generic;
this.nome = String.Empty;
public Pessoa(string nome, int idade)
get { return this.nome; }
set { this.nome = value; }
get { return this.idade; }
set { this.idade = value; }
public static void Main(string[] args)
List<Pessoa> ListaPessoa = new List<Pessoa>();
ListaPessoa.Add(new Pessoa
ListaPessoa.Add(new Pessoa
ListaPessoa.Add(new Pessoa
var pessoa = ListaPessoa[1];
Console.WriteLine($"Nome: {pessoa.Nome}, Idade: {pessoa.Idade}");
pessoa.Nome = "Pessoa X";
Console.WriteLine($"Nome: {pessoa.Nome}, Idade: {pessoa.Idade}");