I'm doing homework and I have to rewrite the StringTokenizer class in Java. When the nextToken()
method is called and there are no more tokens my method should return a value of null. My homework is complete except this part. I don't understand what exactly that means and what I'm supposed to do.
I've searched this website for answers but really don't understand the answers or examples given. My question is how does null fit into the methods nextToken()
or hasMoreTokens()
in the StringTokenizer
class in Java?
Some of the other posts on this subject that I've looked at. What is null in Java?