• Post Reply Bookmark Topic Watch Topic
  • New Topic

[Resolved] StringTokenizer and Reading Text Files

 
Ryan Akim
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am having some trouble using StringTokenizer.
I'm trying to input a word, and parse it using Integer.parseInt()

The problem is the console just seems to halt; perhaps an infinite loop? :S



Is there anything noticeably wrong with the logic here?
Does it have anything to do with line #08?


Edit: Ah, I ran a test and it was an infinite loop. It happened because I never got the next line prior to checking if it was null.
 
Surya Kant
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per the API,Stringtokenizer should work properly.And your posted code is also correct.Did you try to debug it?
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read the last part of Ryan's post, beginning with "Edit:". The problem has already been solved.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!