Write a class Interval with the following API: public class Interval Interval (double min, double max) range
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a class Interval with the following API:
public class Interval
Interval (double min, double max) range is form min to max, inclusive
Boolean contains (double x) is x in the interval of the object?
Bolean intersects (Interval b) does this interval and b intersect?
String tostring () string representation of interval.
Provide a complete class and test the API in the main method.
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Posted Date: