I am working or understanding how to create a simple java 2d maze that should look like this:
int [][] maze =
{ {1,1,1,1,1,1,1,1,1,1,1
If I understand your question correctly, what I would do is: 1. create a board of a specific size (change all the coordinates to your desired number - in your example '1'). I wouldn't use a recursive function, because you will probably end up drawing the whole board (think about what will make the recursion stop).
you can create a function that receives a starting coordination, an ending coordination, and the array (the board). pseudo code of the function: set a variable for the next direction of painting (set it to the starting coordination). paint the next coordination 0. while the next coordination != to the ending coordination: paint the next coordination 0. use Random to set the coordination to one of the 4 directions.
you should add limits (if the next coordination is a painted one/the border of the maze etc... chose a different coordination). good luck!