April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Classes Parametrizadas
nPoint pt = new Point();      // pt contém um ponto
nboolean b = pt instanceof Pixel; // b = false
npt = new Pixel(1,2,3);       // pt contém um pixel
nb = pt instanceof Pixel;     // b = true
n
nPodemos então mudar a definição do nosso TAD para especificar pilhas de objetos genéricos.
n
ninterface StackInterf {
n  boolean isEmpty();
n  void push(Object obj);
n  Object pop();            Exercícios – Questão 6
n
n  Object top();
n}