title: what is equivalent to isEmpty() for integers?
body: <p>Below is the script I have at the moment</p>
  
  <pre><code>import java.util.Arrays;
  import java.util.Scanner;
  
  public class SeeWhatTo 
  {   
       public static void main(String args[]) {
         Scanner scan = new Scanner(System.in); //define scan  
         int a = scan.nextInt();
         int sum =0;
             while (a&gt;0 )
       {                   
              sum = sum +a;
              a = scan.nextInt();    
       }
          System.out.println(sum);   //print out the sum
      }    
  }
  </code></pre>
  
  <p>Currently,  it stores an input value in <code>a</code> and then adds it to <code>sum</code> and once a negative or zero is given as an input, it suspends itself and outputs the sum.</p>
  
  <p>I was wondering if there's an integer equivalent of <code>isEmpty</code> so that i can do <code>while (! a.isEmpty() )</code>  so when there's no input but an enter, then it would stop and prints out the sum.</p>
  
  <p>A natural followup from that would be, is there a way to assign an input integer to a and check if it is empty or not at the same time in the while condition as in <code>while ( ! (a=scan.nextInt()).isEmpty() )</code> </p>