#278 Code Review of the Triangle Entity
Perform a code review:
@Entity
@Table(name = "triangle", schema = "application")
class Triangle {
@Id
private UUID id;
@Column
private int a;
@Column
private int b;
@Column
private int c;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Triangle triangle = (Triangle) o;
return a == triangle.a && b == triangle.b && c == triangle.c;
}
@Override
public int hashCode() {
return com.google.common.base.Objects.hashCode(id, a, b, c);
}
}
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor