Class

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
643,983,104

A good answer might be:

Depends on context. This could be the tokens 643 and 983 and 104 separated by the delimiter character comma, or it could be a single token representing a large integer with thousands and millions marked with commas. Or it could be something completely different.

StringTokenizer Class

The StringTokenizer class breaks a String into tokens. You can use its default delimiters, or you can specify your own. The default delimiters are space, tab, newline, and carriage return.

StringTokenizer constructors public StringTokenizer( String arg )

create a StringTokenizer based on String, using the default delimiters

public StringTokenizer( String arg, String delimit)

create a StringTokenizer based on String, using the individual characters in delimit as delimiters

public StringTokenizer( String arg, String delimit, boolean ret)

as above, but if ret is true, then individial delimiters count as tokens also.

The StringTokenizer class is found in java.util, which must be imported for the program to compile.

QUESTION 15:

Using the default delimiters, how many tokens are in this String:

12  8  5  32