Tenho um pequeno no meu programa.

Exception in thread "main" java.lang.NullPointerException
    at Controle.ControladorAluno.criaAluno(ControladorAluno.java:23)
    at vista.Main.main(Main.java:21)


    public void criaAluno(String nome,String dre)throws
AlunoExistenteException{
        if(alunos.get(dre)== null) alunos.put(dre, new Aluno(nome, dre));
//linha 23

        else throw new AlunoExistenteException("Aluno já existente com DRE",
dre);
    }



Essa parte de baixo é referente a linha 21 de outra parte do código.

try{
            ca.criaAluno("joão", "1111"); // linha 21
            System.out.print("Aluno Criado Ok");
        }

        catch (AlunoExistenteException e){
            System.out.print(e);


Agradeço qualquer ajuda para corrigir o erro.

-- 
You received this message because you are subscribed to the Google Groups "Comp 
2 - Geral" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/comp2-geral?hl=en.

Responder a