Is there a way to define an ArrayList
with the double
type? I tried both
ArrayList list = new ArrayList<Double>(1.38, 2.56, 4.3);
and
ArrayList list = new ArrayList<double>(1.38, 2.56, 4.3);
The first code showed that the constructor ArrayList<Double>(double, double, double)
is undefined and the second code shows that dimensions are required after double
.