Guest jae Posted July 20, 2002 Posted July 20, 2002 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() ?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now