fork download
  1. public class Point {
  2.  
  3. private int x;
  4. private int y;
  5.  
  6. public Point(int x, int y) {
  7. this.x = x;
  8. this.y = y;
  9. }
  10.  
  11. public int getX() {
  12. return x;
  13. }
  14.  
  15. public void setX(int x) {
  16. this.x = x;
  17. }
  18.  
  19. public int getY() {
  20. return y;
  21. }
  22.  
  23. public void setY(int y) {
  24. this.y = y;
  25. }
  26.  
  27. @Override
  28. public boolean equals(Object o) {
  29. if (this == o) return true;
  30. if (o == null || getClass() != o.getClass()) return false;
  31.  
  32. Point point = (Point) o;
  33.  
  34. if (x != point.x) return false;
  35. if (y != point.y) return false;
  36.  
  37. return true;
  38. }
  39.  
  40. @Override
  41. public int hashCode() {
  42. int result = x;
  43. result = 31 * result + y;
  44. return result;
  45. }
  46. }
  47.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty