That isn't a 2D array; Java® only supports 1D arrays. What that is is an array of arrays, which is better. I think you should start by finding the smallest elements in a 1D array, because you can scale it up to more dimensions later.
Please show us the algorithm you are using, as well as the definition of next‑smallest element. Every array with ≥ 2 elements has a next‑smallest element, so you can't say there is no next‑smallest element. Maybe you mean smallest not equal to the actual smallest element; that is something different. Or can you impose a restriction that your arrays are free from repeated values?
I don't understand the code you have been given; I think you will end up deleting it. I tried that code and it didn't work. So forget it. I suggest you start by finding the smallest element in an array, and print,
The smallest element was −43752083 at 97.
Once you have the smallest element, work out how to find the next‑smallest element. It is easy to do with two passes through the array, ut it should be possible by iterating the array only once.