title: How can i insert multiple input in one line in 2dArray looping
body: <p>So i want my output to be something like this:</p>
  
  <pre><code>N = 3
  userinput1  |  userinput2  |  userinput3  
  userinput4  |  userinput5  |  userinput6
  userinput7  |  userinput8  |  userinput9
  </code></pre>
  
  <p>but the problem is after i insert my userinput1 and press enter it goes one space below and become like this </p>
  
  <pre><code>1
    |  2
    |  3
    |  
  4
    |  5
    |  6
    |  
  7
    |  8
    |  9
    |  
  </code></pre>
  
  <p>i tried to change sc.nextInt(); to sc.nextLine(); but it doesnt work even after i used parseInt ..</p>
  
  <p><pre>
       public static void main(String[] args)
              {
                  Scanner sc = new Scanner(System.in);</p>
  
  <code>            int[][] noOfArrays;
              int noOfRows;
              int noOfColumns;
  
              System.out.println("Output : ");
              System.out.print("Input N = ");
              noOfRows = sc.nextInt();
              noOfColumns = noOfRows;
  
              noOfArrays = new int[noOfRows][noOfColumns];
  
              ///////////////////////////////
  
              for(int i = 0; i&lt;noOfRows; i++)
              {
                  for(int j=0; j&lt;noOfColumns; j++)
                  {
                      noOfArrays[i][j] = sc.nextInt();
                      System.out.print("  |  ");        
                  }
                  System.out.println("");
              }
  
  
          }
  </code></pre>