If you are making a platformer or top down rpg style game an array can be very usefull.
As long as you can consistently convert from world coordinates to array coordinates (and back), you can easily iterate only through a subsection of the array that represents what is on the screen by controlling the start and end of the two loops you are using for iterating through the array.
I would recommend creating a "tile" or "square" object or enumerated that you store into the map array rather than ints. Each item in the enumerated list can have a different sprite variable, movement cost variable, ect.
That way you avoid having a bunch of if statements and having to keep track of what variables do what, you can just do testArray[y][x].drawImage(xgridSize,ygridSize); or something along those lines.
This will make it harder to edit your level in a text editor, but making a crude level editor won't take too long and is worth the time.
You might also consider making maps an object (and have them store their tile arrangement in an array). This can be useful, because there might be a bunch of information that you want to save in a level that wouldn't belong in the array.
For example, what level is next, where do enemies start and what enemies are there. You can roll all of that information into a map object.