title: How to get all possible combinations from two arrays?
body: <p>I have the two arrays:</p>
  <pre class="lang-java prettyprint-override"><code>String[] operators = {&quot;+&quot;, &quot;-&quot;, &quot;*&quot;};
  int[] numbers = {48, 24, 12, 6};
  </code></pre>
  <p>And I want to get all possible combination in a String format like this:</p>
  <pre><code>48+24+12+6
  48+24+12-6
  48+24+12*6
  48+24-12+6
  48+24-12-6
  48+24-12*6
  ..........
  48*24*12*6
  </code></pre>
  <p>This what I have tried:</p>
  <pre class="lang-java prettyprint-override"><code>for (int i = 0; i &lt; operators.length; i++) {
      System.out.println(numbers[0] + operators[i] + numbers[1] +
              operators[i] + numbers[2] + operators[i] + numbers[3]);
  }
  </code></pre>
  <p>But it only prints:</p>
  <pre><code>48+24+12+6
  48-24-12-6
  48*24*12*6
  </code></pre>
  <p>How to solve this?</p>
  <p>This is not a duplicate because I don't want to get every two pairs of data, I want to get every combination in 4 pairs. The duplicate is different.</p>