title: Does java 8 having any alternative of normal while loop?
body: <p>I need a while loop alternative in Java 8, can we do that via stream?</p>
  
  <p>Using while loop, we can get string token by below code</p>
  
  <pre class="lang-java prettyprint-override"><code>StringTokenizer stringTokenizer=new StringTokenizer("this is a text string"," ");
  while(stringTokenizer.hasMoreTokens()) {
  System.out.println(stringTokenizer.nextToken());
  }
  
  </code></pre>
  
  <p>But using stream, how can we achieve it?
  please suggest</p>