I have the method threshold(double[] a, double x) that takes a list (a) and a numerical value (x) and returns all the values within a that are greater than x. I am having trouble adding the elements greater than x to a new list containing elements of type double. Here is what I have so far:
public static double[] threshold(double[] a, double x)
{
List<double> ell = new ArrayList<double>();
p = d >x;
ell.add(p);
answer5 = ell;
return answer5;
}
double[]is not the same thing asList<double>. In fact, the latter won't even compile.