class Pessoa {
String nome;
String endereco;
..
}
class Professor extends Pessoa implements Remuneravel {
String nivel;
private Integer salarioMensal;
private Integer diasNoMes;
..
Integer remuneracao() {
return salarioMensal;
};
Integer diasTrabalhados() {
return diasNoMes;
};
..
}
class Aluno extends Pessoa {
Curso curso;
..
abstract boolean concluiu() {
..
}
..
}
class AlunoPos extends Aluno {
String dissertacao;
..
boolean concluiu() {
..
}
..
}
class AlunoGraduacao extends Aluno {
..
Notas notasVestibular;
..
boolean concluiu() {
..
}
}
class AlunoIC extends AlunoGraduacao implements Remuneravel {
..
Projeto projeto;
private Integer valorBolsa;
private Integer diasPesquisa;
..
Integer remuneracao() {
return valorBolsa;
};
Integer diasTrabalhados() {
return diasPesquisa;
};
..
}
}
interface Remuneravel {
Integer diasTrabalhados() {};
Integer remuneracao() {};
}
jhcf@di.ufpe.br
Última edição em 7 de janeiro de 1996.
URL: http://www.di.ufpe.br/~java/verao/aula1/codigos.html