This document defines classes for Points and Lines in Java. The Point class stores x and y coordinates and includes methods for setting/getting coordinates and calculating distance between points. The Line class connects two Points as a start and end, and includes methods for accessing the points and calculating the length of the line. The Main class demonstrates creating Points, a Line between them, and outputting their values and the line length.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
28 views
Point and Line Implementation
This document defines classes for Points and Lines in Java. The Point class stores x and y coordinates and includes methods for setting/getting coordinates and calculating distance between points. The Line class connects two Points as a start and end, and includes methods for accessing the points and calculating the length of the line. The Main class demonstrates creating Points, a Line between them, and outputting their values and the line length.