help creating two classes that function together

Hi i need help making this code into two different classes, the first class is supposed to receive what info the user wants (slope, midpoint, or length) and the info they have (the two x coordinates and the two y coordinates) and send this message to the second class who finds the results and outputs the message. The problem is i don't know how to separate my one code (which functions correctly) into two codes to get two classes. how would i get one class to recieve the info of another? Also my professor mentioned something about making some variables private, but i really don't grasp what making a variable private means. here is my code if it helps at all:

import java.util.*;

class line

{

public static void main ( String [] args )

{

double x0, x1, y0, y1, L, m, x, y, mp;

Scanner scanner;

scanner = new Scanner (System.in);

//User inputs X0

System.out.print("What is the value of X0?");

x0 = scanner.nextInt ();

//user inputs x1

System.out.print("What is the value of X1?");

x1 = scanner.nextInt ();

//user inputs y0

System.out.print("What is the value of y0?");

y0 = scanner.nextInt ();

//user inputs y1

System.out.print("What is the value of y1?");

y1 = scanner.nextInt ();

//finding L

L = (Math.pow((x1-x0),2)) + (Math.pow((y1-y0),2));

//Finding m

m = ((y1 - y0)) / ((x1 - x0));

//finding x midpoint

x = x0 + (.5 * (x1 - x0));

//finding y midpoint

y = y0 + (.5 * (y1-y0));

//display length results

System.out.print ("The length of the line is: " + L + "\nThe slope of the line is: " + m + "\nThe midpoint of the line is: " + x + "," + y);

}

}