title: Replace a while ( 1 == 1) loop in Java
body: <p>I have been unable to find something related to this so far.  I've heard that surrounding the majority of your program in a while loop like this makes the program inefficient, is there any better way to get the same effect? </p>
  
  <pre><code>    while (1 == 1) {
          //User Input 
          System.out.println("Do you wish to roll? (Y/N)"); 
          if (kb.hasNext()) {
              userContinue = kb.next(); 
          }
          if (userContinue.equalsIgnoreCase("n")) {
              System.exit(0);
          }
          //Calculations 
          score = 0; 
          while (userContinue.equalsIgnoreCase("Y")) {
              rollResult = user.rollTwoDie(); 
              score = rollResult + score; 
              if (score &gt; 21) {
                  System.out.println("You loose for going over 21."); 
                  System.out.println("Your final score was: " + score); 
                  score = 0; 
                  System.out.println("Play again? (Y/N)"); 
                  if (kb.hasNext()) {
                      userContinue = kb.next(); 
                  }
                  if (userContinue.equalsIgnoreCase("n")) {
                      System.exit(0); 
                  }
              }
              else if (score &lt;= 21) {
                  System.out.println("Your score is: " + score); 
                  System.out.println("Roll again? (Y/N)"); 
                  if (kb.hasNext()) {
                      userContinue = kb.next(); 
                  }
              }
          }
          if (userContinue.equalsIgnoreCase("N")) {
              while (computerScore &lt;= score &amp;&amp; computerScore &lt; max) {
                  computerResult = computer.rollTwoDie(); 
                  computerScore = computerResult + computerScore; 
              }
              userContinue = computer.checkComputerScore(computerScore, score); 
          }
      }
  </code></pre>