Ae galera to tentando implementar um exceptions aki eu sei q ta errado mais acho q estou no caminho correto vcs podem me dar uma ajuda ae por favor, seguinte:
tenho esta classe que trata as exceçoes:
package br.com.squadra.caixa.persistência.exceptions;
public class ClienteExceptions extends Exception {
public ClienteExceptions (String mensagem){
super(mensagem);
}
}
e tenho outra classe onde quero lançar o throw no seguinte metodo:
public boolean excluirClientes (Long id) throws ClienteExceptions{
for (int i = 0; i < listaClientes.length; i++) {
if (this.listaClientes[i] != null
&& this.listaClientes[i].getId().equals(id)) {
this.listaClientes[i] = null;
return true;
}
}
return false;
throw ClienteExceptions ("lalal");
}
sei q esta errado a linha do throw alguem ajuda ae...