java program to calculate distance between two points
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        // distance between two points
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter coordinates of first point (x1,y1): ");
        int x1 = scanner.nextInt(), y1 = scanner.nextInt();
        System.out.print("Enter coordinates of second point (x2,y2): ");
        int x2 = scanner.nextInt(), y2 = scanner.nextInt();
        double distance = Math.sqrt( Math.pow(x2 - x1 ,2) + Math.pow(y2 - y1, 2) );
        System.out.println("Distance between the points is " + distance);
    }
}