Does anyone know how to pass a double arraylist into another method? (I have highlighted it)I get this message from compiler : cannot convert from ArrayList to double[]
ArrayList<Double> value = new ArrayList<Double>();
while (rs.next())
{
ArrayList<Integer> r=new ArrayList<Integer>();
r.add(rs.getInt("Type"));
r.add(rs.getInt("Budget"));
r.add(rs.getInt("Day"));
r.add(rs.getInt("Preferences"));
int vec2[] = r.stream().mapToInt(t -> t).toArray();
double cos_sim=cosine_similarity(vec1,vec2);
value.add(cos_sim);
}
pick_highest_value_here_and_display(value);
ps.close();
rs.close();
conn.close();
}
private void pick_highest_value_here_and_display(ArrayList<Double> value) {
// TODO Auto-generated method stub
**double aa[]=value ;**
double highest=aa[0];
for(int i=0;i<aa.length;i++)
{
if(aa[i]>highest){
highest=aa[i];
}
}
System.out.println(highest);
}