@Ahamed makes sense, but if you insist on using lists, you have three of these types:
ArrayList<Integer> first = new ArrayList<Integer>(Arrays.AsList(100,100,100,100,100)); ArrayList<Integer> second = new ArrayList<Integer>(Arrays.AsList(50,35,25,45,65)); ArrayList<Integer> third = new ArrayList<Integer>(); for(int i = 0; i < first.size(); i++) { third.add(first.get(i)); third.add(second.get(i)); }
Edit: If these values ββare listed below:
List<double[]> values = new ArrayList<double[]>(2);
what you want to do is combine them, right? You can try something like this: (I assume that both arrays are the same size, otherwise you need to use two for the operator)
ArrayList<Double> yourArray = new ArrayList<Double>(); for(int i = 0; i < values.get(0).length; i++) { yourArray.add(values.get(0)[i]); yourArray.add(values.get(1)[i]); }
yahya source share