If I add an element to a hash map:
this.coloursHashMap1 = new HashMap<int[], int[]>();
int[] cols = new int[]{1,2,3};
int[] coord = new int[]{i,j,k};
this.coloursHashMap1.put(coord, cols);
And then try to access it, does anyone know why I can only get the data by calling getColourFromHashArr() and not getColourFromHashInts() - is the coord array created in the second method functionally different to one passed as a parameter into the first?
public int[] getColourFromHashArr(int[] coord){
return this.coloursHashMap1.get(coord);
} //returns correct value
public int[] getColourFromHashInts(int i, int j, int k){
int[] coord = new int[]{i,j,k};
return this.coloursHashMap1.get(coord);
} //returns null
No matter what I do, I can't seem to get the value from another method, with only passing in the ints seperately. Is there something I'm missing?