I have a lookup table that should be accessed by two separate key values. One ugly way to do this is:
int[][] myArray = new int[256][256];
myArray[key1][key2] = 25;
where key1 and key2 are keys that were previously generated dynamically. But this is rather ugly. It seems that a better way to do this would be to use a Map, but those require a single key, not two. Java doesn't natively support tuples, so what should I use instead? (It also seems awkward to use an array as the key).
EDIT: The reason I say that this isn't particularly pretty is that my array is actually referenced by character values, not integers. They could be used interchangeably, but the responses to my previous question seem to suggest otherwise: