Scanner in a while loop : <p>I'm a beginner in java but I have worked c++ before
in c++ we can code like this :</p>

<pre><code>int num;
while (cin&gt;&gt;num){
....
}
</code></pre>

<p>now I wonder how to do that in java.</p>
