title: Is it possible to return more than one value from a method in Java?
body: <p>I am using a simulator to play craps and I am trying to return two values from the same method (or rather I would like to).</p>
  
  <p>When I wrote my return statement I simply tried putting "&amp;" which compiled and runs properly; but I have no way of accessing the second returned value.</p>
  
  <pre><code>public static int crapsGame(){
    int myPoint;
    int gameStatus = rollagain;
    int d1,d2;
    int rolls=1;
  
    d1 = rollDice();
    d2 = rollDice();
    switch ( d1+d2 ) {
      case 7: 
      case 11:
        gameStatus = win;
        break;
      case 2: 
      case 3: 
      case 12:
        gameStatus = loss;
        break;
      default:
        myPoint = d1+d2;
        do {
          d1=rollDice();
          d2=rollDice();
          rolls++;
          if ( d1+d2 == myPoint )
            gameStatus = win;
          else if ( d1+d2 == 7 )
            gameStatus = loss;
         } while (gameStatus == rollagain);
    } // end of switch
    return gameStatus &amp; rolls;
  }
  </code></pre>
  
  <p>When I return the value as:</p>
  
  <pre><code>gameStatus=crapsGame();
  </code></pre>
  
  <p>It appropriately sets the varaible to win or lose but if I try something as simple as following that statement with:</p>
  
  <pre><code>rolls=crapsGame();
  </code></pre>
  
  <p>It is assigned the same value as gamestatus...a 0 or a 1 (win or lose).
  Any way that I can access the second returned value? Or is there a completely different way to go about it?</p>