Untitled
By: a guest | Mar 21st, 2010 | Syntax:
None | Size: 0.89 KB | Hits: 57 | Expires: Never
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Escola
{
class Turma
{
private int id;
private string nome;
@private ArrayList alunos = new ArrayList();@
public int Id
{
get { return id; }
set { id = value; }
}
public string Nome
{
get { return nome; }
set { nome = value; }
}
@public ArrayList Alunos@
{
get { return alunos; }
set { alunos = value; }
}
}
}
//Lists em C# são Generics, devem ser instanciadas da seguinte forma
// ArrayList<TObject> alunos = new ArrayList<TObject>();
//Troca-se o TObject pelo tipo da lista que vc quer, se tiver uma classe alunos fica assim:
//ArrayList<Alunos> alunos = new ArrayList<Alunos>();