public class Menu {
private static Scanner reader = new Scanner(System.in);
public static void editarPerfil(Aluno aluno, Professor professor) {
System.out.println("Digite seu nome: ");
String nome = reader.next();
System.out.println("Digite sua matricula: ");
int matricula = reader.nextInt();
System.out.println("Digite sua nova senha:");
String senha = reader.next();
if (aluno != null) {
aluno.setNome(nome);
aluno.setMatricula(matricula);
aluno.setSenha(senha);
aluno.exibirDados();
} else {
professor.setNome(nome);
professor.setMatricula(matricula);
professor.setSenha(senha);
professor.exibirDados();
}
}
}
Comments
0 B
|👍
/👎