Sure, you just need to think a bit about the scope of the data, which means when and where you want to use it. For example, here's method scope. I declare a string, get a value and use it all in one method. When I leave the method, it goes "out of scope" and is no longer available.
If I want to use it in another method, I have to make a longer scope. If I store it in a member variable, it lasts as long as the object:
Find a book like Bruce Eckell's Thinking In Java and look up scope in the index. They're likely to have a good discussion. [ November 05, 2003: Message edited by: Stan James ]
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
I promise I will be the best, most loyal friend ever! All for this tiny ad: