public boolean hasNextWord(){
  int index=remaining.indexOf(' ');
  return hasNext() && index < remaining.length() - 1;
}

public boolean hasNextWord ( ) { int index = remaining . indexOf ( ' ' ) ; return hasNext ( ) && index < remaining . length ( ) - 1 ; }
returns true if there is another word to go to . a word is delimited by a space .
