It was giving runtime error(ArrayOutOfBounds)

It was giving runtime error(ArrayOutOfBounds) when i want to create a rectangular maze. So i checked a little bit and found that 'i' and 'j' are mixed up.