Looping through tokens

Hi again,
I'm currently stuck on a program. I have a string that is turned into tokens. I need to loop through the tokens and so the output will look something like this:
Bob 45 34 29 1 87 total 197
total Bob 98 34 23 23 total 178
and so on. I know the code I have right now isn't close to being correct but I wanted to get the idea i had down quickly. I wanted to see if i'm on the right(ish) track or should abandon this method and go a different way? and also when I'm looping and trying to check what type the next token is how do I do that? Like so, if (S = word) or if (S = float).
Thanks in advance

hi Landon, your code if full of errors. please learn the basics like the difference between = and ==, otherwise you will never be able to wrote advanced code. a starting point is here Java Tutorials and then follow the links in the section Trails the Basics. said that here is some code that produce the output like

Bob = word
45 = int

and so on. note that the number are all formatted as integer and not float.