The documentation says,
«StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.»
I'd also add that java.util.Scanner mostly supplants the token-based reading methods, with the exception of countTokens().
StreamTokenizer is kind of in the same boat as StringTokenizer. (Also note that StreamTokenizer is in java.io.)
«StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.»
I'd also add that java.util.Scanner mostly supplants the token-based reading methods, with the exception of countTokens().
StreamTokenizer is kind of in the same boat as StringTokenizer. (Also note that StreamTokenizer is in java.io.)