title: How can i randomly select only one size in a two-dimensional array
body: <pre class="lang-java prettyprint-override"><code>String[] dizi_paragraf = dosya.split("\n");
  for (int i = 0; i &lt; dizi_paragraf.length; i++) {
      String[] dizi_cumle = dizi_paragraf[i].split("\\.");
      String[][] dizi_total = new String[dizi_paragraf.length][dizi_cumle.length];
      int[][] dizi = new int[dizi_paragraf.length][dizi_cumle.length];
      for (int j = 0; j &lt; dizi_cumle.length; j++) {
          dizi_total[i][j] = dizi_cumle[j];
          dizi[i][j] = j;
          System.out.println(dizi[i][j]);
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>0-0
  0-1
  1-0
  1-1
  1-2
  2-0
  3-0
  3-1
  4-0
  4-1
  5-0
  5-1
  5-2
  5-3
  </code></pre>
  
  <p>I want this:</p>
  
  <pre><code>    0-1
      0-0
      1-1
      1-0
      1-2
      2-0
      3-1
      3-0
      4-0
      4-1
      5-3
      5-1
      5-0
      5-2
  </code></pre>
  
  <p>This is an example.
  The value in j for each i changes randomly but until j length.
  How can I do this? Have you any ideas?
  For example, it should produce 0 or 1 for index 0. It should produce 0.1 or 2 for the 1st index. 2. You should take only 0 for indis. etc.
  Just example. This can be change. I take this dynamically. </p>
  
  <p>"i" must be constant. But j should be chosen randomly. for indice 0, j value: 0 and 1. This should be chosen randomly. for indice 1, j value: 0,1 and 2. This should be chosen randomly.</p>