// while there's another token to read while in.hasNext() // if it's a number if in.hasNextInt() read it as a number else // ignore it in.next() |--------------+-----------------| | nextInt() | hasNextInt() | | nextDouble() | hasNextDouble() | | next() | hasNext() | |--------------+-----------------|