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 comma, or it could be one token representing a large integer with thousands and millions marked with commas. Or it could be something completely different. | ||||||||
| ||||||||
| 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. |
Here is a tiny program that constructs a StringTokenizer
from a command line parameter.
The tokenizer will use the default delimiters.
The program doesn't do anything, yet.
import java.util.* ;
public class TokenTester
{
StringTokenizer tok;
public static void main ( String[] args )
{
if ( args.length > 0 )
{
tok = new StringTokenizer( args[0] );
}
}
}
The StringTokenizer class is found in java.util,
which must be imported for the program to compile.
Using the default delimiters, how many tokens are in this string:
Click Here after you have answered the question12 8 5 32