Escolar Documentos
Profissional Documentos
Cultura Documentos
Método toString
@Override
public String toString() {
return "Pessoa: " + nome + ", " + endereco + ", " + telefone + '.';
}
}
Programação Orientado a Objetos
Método equals
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Pessoa other = (Pessoa) obj;
if (!Objects.equals(this.nome, other.nome)) {
return false;
}
return true;
}
}
Bibliografia Base
BARNES, David J.; KÖLLING, Michael. Programação Orientada a Objetos com Java:
uma introdução prática usando o BlueJ - 4a edição. Pearson, ISBN: 9788576051879.
DEITEL, Paul; DEITEL, Harvey. Java: como programar. 8. ed. São Paulo: Pearson
Prentice Hall, 2010. 1176 p. ISBN 9788576055631.
DEITEL, Harvey; DEITEL, Paul. Java: Como programar. 10. ed. São Paulo: Pearson
Education do Brasil, 2017. ISBN 9788543004792.