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: 
`Point` class won't give the double precision. For the double precision you need to use [**Point2D.Double**](https://www.cs.rit.edu/usr/local/jdk/docs/api/java/awt/geom/Point2D.Double.html) class. Consider the following code as example. 

```
    static void pointTest() {
      double x = 1.2;
      double y = 3.4;
      Point2D.Double pointDouble = new Point2D.Double(x, y);
      System.out.println(pointDouble);
    }

```
Use this class:

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

```

maven:

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

```