I want to add x elements (just keys) from sorted map to list and display them.
public static ArrayList<int[]> miZrodzicowIpotomstwa(Map<int[],Double> mapVectFunc_tmp, int x)
{
ArrayList<int[]> listaMi = new ArrayList<>();
ArrayList<int[]> klucz_t = new ArrayList<>(mapVectFunc_tmp.keySet());
for(int i=0; i<x; i++)
{
listaMi.add(klucz_t.get(i));
}
return listaMi;
}
in main:
Map<int[],Double> mapVectFunc = new LinkedHashMap<int[],Double>();
int []t1={1,0,0,1};
int []t2={1,1,0,0};
int []t3={1,0,1,1};
mapVectFunc.put(t1,26.0);
mapVectFunc.put(t2,1.0);
mapVectFunc.put(t3,6767.0);
ArrayList<int[]> ll= miZrodzicowIpotomstwa(mapVectFunc, 2);
System.out.printf("\n list of two keys: "+ll);
I received the following values(not arrays) :
list of two keys: [[I@54bedef2, [I@5caf905d]
Does anybody has an idea how to convert it into arrays?