Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 21st, 2010 | Syntax: None | Size: 0.89 KB | Hits: 57 | Expires: Never
Copy text to clipboard
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections;
  5.  
  6. namespace Escola
  7. {
  8.     class Turma
  9.     {
  10.         private int id;
  11.         private string nome;
  12.         @private ArrayList alunos = new ArrayList();@
  13.  
  14.         public int Id
  15.         {
  16.             get { return id; }
  17.             set { id = value; }
  18.         }
  19.  
  20.         public string Nome
  21.         {
  22.             get { return nome; }
  23.             set { nome = value; }
  24.         }
  25.  
  26.         @public ArrayList Alunos@
  27.         {
  28.             get { return alunos; }
  29.             set { alunos = value; }
  30.         }
  31.     }
  32. }
  33.  
  34. //Lists em C# são Generics, devem ser instanciadas da seguinte forma
  35. // ArrayList<TObject> alunos = new ArrayList<TObject>();
  36. //Troca-se o TObject pelo tipo da lista que vc quer, se tiver uma classe alunos fica assim:
  37. //ArrayList<Alunos> alunos = new ArrayList<Alunos>();