title: How to end this program when user inputs "end"?
body: <p>So basically I am trying to figure out how to stop this program using <code>Integer.valueOf(String s)</code> or <code>Integer.parseInt(String s)</code> by typing "end" for the user input</p>
  
  <pre><code>import java.util.Scanner;
  
  public class monkey1{
      public static void main(String[] args){
          Scanner s = new Scanner(System.in);
          int sum = 0;
          int lol = 1;
          do { 
              System.out.print("Enter a number: ");
              lol = s.nextInt();
              sum += lol;
              if (lol &gt; 0) {
                  System.out.println("Sum is now: " + sum);
              }
          } while (lol&gt;0);
      }
  }
  </code></pre>