Author | Topic: Stack |
Dadi greenhorn |
posted March 10, 2000 03:50 PM
What is the output when you try to print out each Stack. A class was given in the main() method: This is from Kai's note. Is the answer E ??
|
maha anna bartender |
posted March 10, 2000 03:59 PM
Yes. The ans is s1[100] s2[]. These are all can be easily found by compiling and executing. In that way we come to understand the concept quickly and easily. By making modifications to the code and testing, you know yourself which is correct. You do not have to ask again yourself. regds maha anna
|
Tony Alicea sheriff |
posted March 10, 2000 04:00 PM
If you mean does the stack denoted by the variable s1 have an Integer of value of 100 and the second stack nothing? I think that's correct. The s1 and s2 inside the method are just local variables and although you can change the state of the objects which they denote, you cannot change the values associated with them outside of the method.
|
| | |