Jump to content

I need java help.


Guest jae

Recommended Posts

A portion of my Java project says:

 

void getCommand() reads in a line of input and sets up a StringTokenizer Object to parse it later.

 

boolean hasTokens() returns true if the tokenizer Object is not null and still has more tokens, false otherwise.

 

String getToken() returns the next token of the tokenizer.

 

These methods are all in the same class. getCommand(), has no parameters and a void return-type -- getCommand sets up a StringTokenizer called tokenizer.

 

Now, hasTokens() from the same class, also without any parameters, is supposed to determine if the tokenizer I set up in getCommand() hasMoreTokens.

 

Is it even possible to somehow call getCommand.tokenizer.hasMoreTokens() ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.