I would like to know how can I iterate in a 2Dimensional HashMap? I am creating an Object TrueStringMap2D that does the following: It will be a map 2D, i mean 2 keys and one value.
But the iterator implemented here is not functional.. i didnt know how to redefine the Iterator method in TrueStringMap2D :S (if possible should be remove in the iterator() functional)
Anyone can help?
Thankyou very much!!
I’ll reinterpret the question into something similar that I enjoy answering, and then hopefully the answer to that question is useful to you.
Here’s the question I’ll answer:
This is how I would solve it:
Test code:
Output: