title: Craps game: How do i get the while loop in this code from going into an infinite loop?
body: <p>this are comments that explain the game so you can test it, but the main problem is when you are suppose to run the while loop if you a point value then it becomes an infinite loop. How do I get it to not be an infinite loop?</p>
  
  <pre><code>import java.util.Random;
  
  public class Craps {
      private int roll1;
      private int roll2;
      private Random randGen;
      private int sum;
      private int thePoint = sum;
      private int bet;
      private int newSum;
  
      // instance classes
      public Craps() {
          randGen = new Random(); // this is the random generator
      }
  
      // when you win you double your money
      // when you lose you lose everything
      public void roll(int bet) { // you can bet as much money as you want
          roll1 = (randGen.nextInt(6) + 1);
          roll2 = (randGen.nextInt(6) + 1);
          sum = roll1 + roll2; // you must add the two rolls and that is your sum
          if (sum == 2 || sum == 3 || sum == 12) { // if the sum is 2 you lose
              System.out.println("The sum is 2. You Lose!");
              System.out.println("Your credit:" + " " + bet * 0);
          } else if (sum == 7 || sum == 11) { // if it 7 you win
              System.out.println("The sum is 7. You Win!");
              System.out.println("Your credit:" + " " + bet * 2);
          } else {
              System.out.println("You rolled a" + " " + sum + ". " + "That is your point. Roll      again.");
              sum = thePoint;
  
          }
      }
  
      public void rollAgain() {
  
          while (sum != 7 || sum != thePoint) { // whatever the the sum is that is not one of the numbers above becomes your point.
              roll1 = (randGen.nextInt(6) + 1);// you must role the die again until you get your point again the you win or until you get a 7 and then you lose.
              roll2 = (randGen.nextInt(6) + 1);
              sum = roll1 + roll2;
              if (thePoint == sum) { // if the point equals the sum you win
                  System.out.println("You're on point. You Win!");
                  System.out.println("Your credit:" + " " + bet * 2);
              } else if (sum == 7) { // if it equals 7 you lose.
                  System.out.println("You got a 7. You lose!");
                  System.out.println("Your credit:" + " " + bet * 0);
              }
          }
      }
  }
  </code></pre>