public class Point
extends java.lang.Object
Constructor | Description |
---|---|
Point(int x,
int y) |
Initializes a newly created Point object which has an x coordinate and a y coordinate.
|
Modifier and Type | Method | Description |
---|---|---|
double |
distance(Point b) |
Computes the distance between the current Point object and another Point.
|
boolean |
equals(java.lang.Object o) |
Compares this point to a specified object.
|
int |
hashCode() |
Auto-generated hashCode method using IntelliJ
|
java.lang.String |
toString() |
String representation of the Point object
|
public Point(int x, int y)
x
- the x coordinatey
- the y coordinatepublic double distance(Point b)
b
- the other pointpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare the point againstpublic int hashCode()
hashCode
in class java.lang.Object