基本的に、次のメソッドを作成する必要があります。
public boolean doesContain(double x)
これは次のように機能します:
Returns true if and only if x lies between left and right, and the
interval is not empty (i.e. left < right).
そして、これはクラスがどのように見えるかです:
public class Interval {
private double left;
private double right;
public Interval(double left, double right){
this.left = left;
this.right = right;
}
public boolean doesContain(double x){
ArrayList<Double> nums = new ArrayList<Double>();
//Add code here
}
}