I am very new to java and I am currently trying to recreate some python code in java. This is my problem:
I have 2 different variables:
ArrayList <Double> x_loc= new ArrayList<>();
ArrayList <Double> y_loc= new ArrayList<>();
They both represent coordinates. My goal is to now create a 2-dimensional array with both of them so I could have something like array([[x1,y1],[x2,y2],...]).
I've thought about creating a new ArrayList and then adding each individual item:
ArrayList<Double[]> data_fin = new ArrayList<>();
data_fin.add(x_loc)
However, this doesn't work. I know I'm probably doing something very stupid but, as a newbie, I'd really appreciate your help. Thanks!
> this creates a two dimensional list and you won't have the complexity of index matching between the two separated arrays
– Sergio Arrighi Nov 19 '19 at 15:20