When I run this line is primarily performs the second function [nextToken()] then it is running the first function [countTokens()] then prints the return of the first and then the return of the second.
Why the first function does not start before the second?
So at first st1.nextToken() can be executed or operator <<( cout, st1.countTokens() ) is executed as arguments of external function operator <<.
Your compiler executes the right operand st1.nextToken() first.