Posts by Felipe Nascimento • 11 points
2 posts
-
0
votes1
answer170
viewsA: How to override equals for it to compare: primitive objects and keys (int, String, double)
Solved @Override public boolean equals(Object o) { if (o instanceof Pessoa) { return ((Pessoa) o).idade == this.idade; } else if (o != null) { //Parse no valor inteiro para Integer return new…
-
1
votes1
answer170
viewsQ: How to override equals for it to compare: primitive objects and keys (int, String, double)
Is there any way to compare? because in my code, if it is not int or Object the program throws an exception. To be able to use in the method contains the Listsequential class. Classe Pessoa public…