Java AWT Point2D create

Description

Java AWT Point2D create

import java.awt.Point;
import java.awt.geom.Point2D;

public class Main {
    public static void main(String[] args) {
        Point2D pointA = new Point2D.Double(2.5555555, 3.77777777);
        Point2D.Float pointB = new Point2D.Float(11.5555555F, 10.2f);
        Point pointC = new Point(100, 100);

        System.out.println("pointA = " + pointA.getX() + ", " + pointA.getY());
        System.out.println("pointB = " + pointB.x      + ", " + pointB.y);
        System.out.println("pointC = " + pointC.x      + ", " + pointC.y);
    }/* w  w w  .  ja v  a  2  s. co  m*/
}



PreviousNext

Related