posted 12 years ago
I've got an int that I need to pass into another class's method; what's the best way for me to do that? Declare the int as static? Although it wouldn't help right? Make it a separate method? Or try and use setters and getters which I don't really understand?
The int is keeping track of how many lines have been processed; I set up a loop to read the lines in the array myString, and used a variable called lineCounter to keep track in the method parseCommands in the main. Now I need the value of lineCounter to be passed into this class EndStatement; not sure how to get it in there though. Can someone help, or link to an example that shows how? Thanks!
Class I need to get the variable into:
"How do you define fool?"
"I don't attempt it. I wait for demonstrations. They inevitably surpass my imagination."