public class Point3D
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
x
The x coordinate.
|
int |
y
The y coordinate.
|
int |
z
The z coordinate.
|
Constructor and Description |
---|
Point3D()
Creates an instance with coordinates (0, 0, 0).
|
Point3D(int x,
int y,
int z)
Creates an instance with given coordinates.
|
Modifier and Type | Method and Description |
---|---|
Point3D |
clone()
Returns a copy of this point with same coordinates.
|
boolean |
equals(java.lang.Object obj)
Checks whether the coordinates of the given Point3D
are equal to the coordinates of the current instance
(overrides Object.equals()).
|
java.lang.String |
toString()
Returns a string that represents this Point3D.
|
public int x
public int y
public int z
public Point3D(int x, int y, int z)
x
- the x coordinatey
- the y coordnatez
- the z coordinatepublic Point3D()
public Point3D clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object whose coordinates are checkedpublic java.lang.String toString()
toString
in class java.lang.Object