Write a class called Line that represents a line segment between two Points. Your Line objects should
Question:
Write a class called Line that represents a line segment between two Points. Your Line objects should have the following methods:
public Line(Point p1, Point p2)
Constructs a new Line that contains the given two Points.
public Point getP1()
Returns this Line ’s first endpoint.
public Point getP2()
Returns this Line ’s second endpoint.
public String toString()
Returns a String representation of this Line , such as "[(22, 3), (4, 7)]".
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: