How do I show the values in both dimensional arrays?
<p>I want to insert Coordinate x and y into both dimensional arrays and print it out. For the example given to the given code when it asks for input it doesn't do it once but twice then accepts the value. I don't if the values are actually getting stored in each array or just one. Is it possible to show output independently of the matrix? I aprecciate any help or corrections! Bless you.
Here's the code:</p>

<h1>Code</h1>

<pre><code>import java.util.Scanner;

public class MummyMadness {

    public static void main(String []args){


    int [][] desert = new int [1][1];
    int x =0;
    int y =0;
    int mummies[] = new int [1];
    int Mlimit = 100000;


    coordinates(desert,mummies,x,y);
    }
    public static int[] inputmummy(int mummies[], int Mlimit){
        int i;
        Scanner input = new Scanner(System.in);
        System.out.println("How many mummies you want?");
        System.out.println("Note that the limit of mummies is 100k");
        i = input.nextInt();

        if(mummies[i] &gt; Mlimit)
        {
            System.out.println("You exceeded from the mummies!");
        }


        return mummies;
    }



    public static int[][] coordinates(int desert[][],int mummies[], int x, int y){


        //Idea use length of mummies for coordinates but if you take out desert i doesnt work


         System.out.println("Enter mummy coordinates");

           for(int i = 0; i &lt; desert.length; i++){

         System.out.println("Enter x:"); 
         Scanner input = new Scanner(System.in);

              if(input.nextInt() &gt; desert.length)
              {
                  System.out.println("Error x exceeded desert length");
                  break;
              }
               desert[i][0] = input.nextInt();

            System.out.println("Mummy location x: " + desert[i][0]);

            for(int j = 0; j &lt; mummies.length; j++){

         System.out.println("Enter y:");     
         Scanner input2 = new Scanner(System.in);

                if(input.nextInt() &gt; desert[0].length)
              {
                  System.out.println("Error y exceeded desert length");
                  break;
              }

                 desert[0][j] = input2.nextInt();

                System.out.println("Mummy location y: " + desert[0][j]); 
                System.out.println(desert[i][j])


            }

        }

        return desert; 

        }

    }
</code></pre>
