0

I have a quick question that I'm hoping someone can help me with on here. I have 2 2d int arrays that I create for a board state and a solution that look something like this:

int[][] P1 = new int[][]{{0,2,0,0,0,0},{0,0,3,0,0,0},{5,0,0,0,0,0} etc. ect.

They're 6x6 arrays and I need a way to compare the two arrays to see if they're exactly equal, I can only compare memory references. I've researched this a bit and can't find a solution. I would like help quickly if possible. Thanks!

Edited by JJHT7439: n/a

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by JJHT7439
0

check out the deepEquals method of the Arrays class.

Wow thanks a lot, can't believe I never saw that mentioned.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.