b is a local variable to the modify method. By changing b to point to a, you are doing nothing to the b in the main method. Try it by changing the variable names in the modify method to c and d to perhaps make it a bit clearer. Look at this code:
When you understand this code, grasshopper, you will have reached a deeper understanding of pointers.
Nmurar01, the answer "A,B" is correct. In modify method, if you make changes to objects' values then the changes would be visible in main method, but if you make changes to objects' reference, these changes will not be visible in calling method. Best regards, -Asif
Now I understand the meaning of early birds catch the worm. Moderators
Joined: Mar 11, 2002
Hello Moderators, I had this question on my exam only variable names were different and the modify method included additional append call between the variables. Early birds still managed to eat the worms???