Skip to content

Instantly share code, notes, and snippets.

@naaando
Created April 11, 2017 22:02
Show Gist options
  • Select an option

  • Save naaando/1087fde7cca69e203fac4ea2ec68f355 to your computer and use it in GitHub Desktop.

Select an option

Save naaando/1087fde7cca69e203fac4ea2ec68f355 to your computer and use it in GitHub Desktop.
void remocao() {
System.out.println("\nDigite o nome da pessoa a ser removido");
String k = scan.nextLine();
PessoaContato aRemover = null;
for ( PessoaContato p : lista1 ) {
if (p.getNome().equals(k)) {
aRemover = p;
}
}
String msg = lista1.remove(p)?"Usuario Removido":"Usuario nao existe";
System.out.println(msg);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment