Write a program that prompts user to enter two points (x1,y1) and (x2, y2) and display the distance between them. The formula for computing distance is: square root of(x2-x1)^2 + (y2-y1)^2

This is what I have:

```
import java.util.Scanner;

public class TwoPoints {
    private static double x;
    private static double distance;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter first two points (x1,y1) :");
        double x1 = input.nextDouble();
        double y1 = input.nextDouble();

        System.out.print("Enter second two points (x2,y2) :");
        double x2 = input.nextDouble();
        double y2 = input.nextDouble();
        x = ((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));

        distance = Math.sqrt(x);
        System.out.print("The distance of the two points is " + distance);

```

However:

I keep getting the following error:

```
Enter first two points (x1,y1) :4,2
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:909)
at java.util.Scanner.next(Scanner.java:1530)
at java.util.Scanner.nextDouble(Scanner.java:2456)
at TwoPoints.main(TwoPoints.java:23)

Java Result: 1

BUILD SUCCESSFUL (total time: 4 seconds)

```

Please help. Thanks