Writing a method that uses objects, Point edition

  1. Create a project called "Point" in Eclipse.
  2. Create two classes, Main and Point in the project. (They should end up in the "(default package)" folder.
  3. Copy the contents of the two links, below, into the Main and Point classes, respectively.
  4. Write the code for the distance method in the Point class so that the code in the Main class will run correctly and print the distance from (-3,5) to (1,2).

 

Main.java

Point.java