Classes and Objects - Hands on 1

import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
 public static void main(String args[] ) throws Exception {
 int x1,y1,x2,y2;
 Scanner scn=new Scanner(;
 Point p1=new Point(x1, y1);
 Point p2=new Point(x2, y2);
 double distance=findDistance(p1, p2);
 public static double findDistance(Point p1, Point p2)
 double distance=Math.sqrt((p2.x-p1.x)*(p2.x-p1.x)+(p2.y-p1.y)*(p2.y-p1.y));
 return distance;
class Point
 int x,y;
 Point(int x,int y)


©2018 by The real one. Proudly created with