Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Point2D {
- private float x = 0.0f;
- private float y = 0.0f;
- public Point2D(float x, float y) {
- this.x = x;
- this.y = y;
- }
- public Point2D() {
- }
- public float getX() {
- return x;
- }
- public void setX(float x) {
- this.x = x;
- }
- public float getY() {
- return y;
- }
- public void setY(float y) {
- this.y = y;
- }
- public void setXY(float x, float y) {
- this.x=x;
- this.y = y;
- }
- public float[] getXY(){
- float[] result = { this.x , this.y };
- System.out.println(result);
- return result;
- }
- @Override
- public String toString() {
- return '(' +
- "x=" + x +
- ", y=" + y +
- ')';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement