• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Question for Frank Carver

 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
H Frank you gave a pretty reply to a topic by Jamie http://www.javaranch.com/ubb/Forum1/HTML/000103.html
That you read both the long listings he provided amazes me
I have one question though, your comment:

Originally posted by Frank Carver:
and move the definitions of

to inside the "while" loop where they are used.



Surely this will mean that you will initialize the strings every time the loop is "executed'. Why do you suggest that he moves it into the loop.
Thanks for sharing you obvious in depth knowledge by the way.
JdJ
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the comments. I'm equally amazed that you are re-reading old messages from over a year ago!
In the case you mention, both strings are never used with their default initialized values. If you follow the code down, looking for the first use of each of the two variables, the first use is when they are set. So a better use would be something like:
 
Johannes de Jong
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At first I though you did not answer my question, then I printed it out compared your code with the original line for line, and the penny droped.
This was what you meant in your original comment to Jamie, intialize via the input you get from the user and not simply do this :

Man I'll be watching out for you and learning from you
Thanks
JdJ
[This message has been edited by Johannes de Jong (edited March 01, 2001).]
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!