title: Java - quick way of assigning array values to individual variables
body: <p>I have a method which will return two strings in an array, <code>split(str, ":", 2)</code> to be precise.</p>
  
  <p>Is there a quicker way in java to assign the two values in the array to string variables than</p>
  
  <pre><code>String[] strings = str.split(":", 2);
  String string1 = strings[0];
  String string2 = strings[1];
  </code></pre>
  
  <p>For example is there a syntax like</p>
  
  <pre><code>String&lt;string1, string2&gt; = str.split(":", 2);
  </code></pre>
  
  <p>Thanks in advance.</p>