public class Aluno {
protected String nome;
protected String tipoAluno;
public Aluno(String nome, String tipoAluno) {
this.nome = nome;
this.tipoAluno = tipoAluno;
}
void identificar(){
System.out.printf("Aluno: %s - Tipo: %s\n", nome, tipoAluno);
}
public static void main(String[] args) {
Aluno aluno1 = new Aluno("Fernanda", "regular");
Bolsista aluno2 = new Bolsista("Lucas");
aluno1.identificar();
aluno2.identificar();
}
}
public class Bolsista extends Aluno {
public Bolsista(String nome) {
super(nome, "bolsista");
}
}