title: I need a ternary operator in Java that assigns two variables if the condition is true
body: <p>I have seen that one can use multiple ternary conditions, but haven't found a way to assign two variables if a single condition is true. This is the method I'm trying to write:</p>
  
  <pre><code>    int[] chkNext(int mnd, int y) {  
          int[] date = new int[2];  
          mnd = 12 ? mnd = 1, y++ : mnd++; // returns the following: "error: : expected"
          date[0] = mnd, date[1] = y;  
          return date;  
      }  
  </code></pre>