Before getting to the comparison issue, I think you need to figure out how you're going to iterate through these arrays. In other words, how can you set up loops to systematically look at each int value in array2:
array2[0][0]
array2[0][1]
...
array2[0][4]
array2[1][0]
array2[1][1]
...
array2[1][4]
array2[2][0]
array2[2][1]
...
array2[2][4]
Before you go too far down this road: The replacement concept
could be made to work if you really wanted to do that, but that's making it much more complicated than it needs to be. (Note that these arrays hold ints, so you wouldn't be able to put Strings in them. Instead, you could use some special value like -1.) But why go through the array twice? And why perform replacements to count later? As soon as you know that you have a match, just increment the count.
But like I said, work out the iteration
pattern first.

[ January 11, 2006: Message edited by: marc weber ]