Multiple choice

Which of the following methods is used to calculate the number of times the tokenizer's nextToken method can be called before it generates an exception?

  1. numberOfTokens()

  2. countTokens()

  3. numberOfElement()

  4. tokens()

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The countTokens() method is used to calculate the number of times the tokenizer's nextToken method can be called before it generates an exception