I am using the StringToken class to tokenize my input as follows:
StringTokenizer tokens = new StringTokenizer(input); n = tokens.countTokens(); a = tokens.nextToken() However, I found that split is more efficient, is there a way how to get the number of tokens (instead of countTokens) and a way to get the next token if I use split?