So I was going to add 5 random numbers to an arraylist(PolyArr). I am only a beginner in Java and do not know the syntax well. Can you please tell me how to correctly format my last line?
'package ga1;
import java.util.*;
import java.lang.Math;
public class GA1 {
static int k=5;
public static void main(String[] args) {
double a;
List<Double[]> PolyArr= new ArrayList<>(k);//Creating the arraylist
for (int i=0; i<k; i++){
a = Math.random() * 50;
//PolyArr.add(new Double() {a});
}
}
}'