title: All possible permutations of 2D array
body: <p>Yesterday I asked a question which appeared to be a duplicate, this one, however, I am pretty sure is not a duplicate, as this one is a teeny bit more advanced. The title does not explain all of it, so do carry on reading.</p>
  
  <p>Let us pretend we have a 2D array like so:</p>
  
  <pre><code>{{true, false}, {true, false}, {true, false}, ...}
  </code></pre>
  
  <p>Now, let us say we would like to loop through all possible permutations of it:</p>
  
  <pre><code>{{false, true}, {true, false}, {true, false}, ...}
  {{true, false}, {false, true}, {true, false}, ...}
  {{true, false}, {true, false}, {false, true}, ...}
  {{false, true}, {true, false}, {false, true}, ...}
  </code></pre>
  
  <p>And so forth...</p>
  
  <p>Since this adds a level to it, it seriously confuses my mind. We know that the length of the inner arrays are always two, this will never change. That is:</p>
  
  <pre><code>boolean[][] b = new boolean[i][2];
  </code></pre>
  
  <p>What is the best way to accheive all possible permutations of a 2D array, using Java?</p>
  
  <p>Thank you,</p>