Hello everyone!
I have a question about arrays. I was generally under the assumptiong that you could call a method from an object that's stored in an array directly, for instance as follows:
stuff s[];
s = new stuff[3];
//Assuming the 's' class object has a get method
s[1].get();
I have something similar in my program but I keep getting an error message that says it can't resolve the symbol 's' from the last line. This creates a problem as I'm using a for loop to run through my array so that I can get to each object's method and output a string result. Can anyone tell me if I'm doing this right or wrong?
Thanks,
Jisoo22
I have a question about arrays. I was generally under the assumptiong that you could call a method from an object that's stored in an array directly, for instance as follows:
stuff s[];
s = new stuff[3];
//Assuming the 's' class object has a get method
s[1].get();
I have something similar in my program but I keep getting an error message that says it can't resolve the symbol 's' from the last line. This creates a problem as I'm using a for loop to run through my array so that I can get to each object's method and output a string result. Can anyone tell me if I'm doing this right or wrong?
Thanks,
Jisoo22