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: 
Use this class:

```
import org.springframework.data.geo.Point;

```

maven:

```
<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

```
Heres a minimum change solution:

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

   Point origin;
   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  = new Point(x, y);
       }

```

You could also implement your own Point class something like this

```
    public class Point {

      double x;
      double y;

     public Point(double x, double y){
       this.x = x;
       this.y = y;
     }

     public double getX(){
       return this.x;          
     }

     public double getY(){
       return this.y;          
     }
   }

```

Hope this helps