Question: I am trying to create several points in a java program. The coordinates of the points are in a text file, which I scan in and read number by number.

```
   double x = 0.0;
   double y = 0.0;

   Point origin = new Point(x, y);
   Point[] points = new Point[1000]; // There are 1000 points in total, thus 2000 doubles, this array will be used to store all the points

   Scanner keyboard = new Scanner(System.in);
   String FileName = keyboard.nextLine();       
   Scanner linReader = new Scanner(new File(FileName));

   while (linReader.hasNextDouble()) {     
       x = linReader.nextDouble();
       y = linReader.nextDouble(); 

       origin = (x, y); // error telling me 'cannot convert from double to point'
       }

```

I get the error "cannot convert from double to a point" so I need to know how to I fix this error? Am I allowed to use doubles coordinates for points?

Answer: 
```
public static void  main(String args[]) {

    //// Alternative 1 
    double x = 9.7;
    double y = 8.6;

    //import com.sun.javafx.geom.Point2D;
    Point2D point2D = new Point2D();
    point2D.x = (float) x; point2D.y= (float) y;

    ///// Alternative 2 (lose some accuracy) 
    //use Double object   
    Double x1 = 9.7;
    Double y1 = 8.6;
    //import java.awt.Point;
    Point origin = new Point(x1.intValue(), y1.intValue());
}

```
Seems more straightforward to do it like this:

```
List<Point> points = new ArrayList<Point>(1000);

...

    points.add(new Point(x, y));

```