This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Happy Holidays! The problem is the program works just fine until it hits a blank line. Then the jvm takes up 99% of my resources and the my gui locks on my screen. Sry for the long code, but figure it'll be easier to diagnose. tried if(inputLine.equals("")continue; and if(inputLine.equals("")inputLine = reader.readLine(); no avail
[ December 28, 2003: Message edited by: Tony Fabeets ]
This takes advantage of the fact that in Java an assignment clause (line = something) is a function. That is, it not only assigns a value to a variable, but returns that value, too. So in one swell foop we can read a line, check it for null and terminate the loop. With this in place, your "continue" clause will skip the rest of the loop and read another line.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Dec 22, 2003
It's still blowing up on the empty line, no matter what i try... help please?
.equals("\r") fixed the prob [ December 24, 2003: Message edited by: Tony Fabeets ] [ December 24, 2003: Message edited by: Tony Fabeets ] [ December 24, 2003: Message edited by: Tony Fabeets ]