Hi everyone, This is the question from Dan's mock exam, please go through the code..
What is the result of attempting to compile and run the program?
a. Prints: 1,1 b. Prints: 1,3 c. Prints: 3,1 d. Prints: 3,3 e. Run-time error f. Compile-time error g. None of the above
The answer given is a, but i am not able to understand how 1,1 is printed. Can any one explain this, appreciate your time Thanks
(top secret [C0DE][/C0DE] tags added) [ October 15, 2004: Message edited by: Barry Gaunt ]
Joined: Jun 23, 2004
Ok If i understand the question well, the values of the arrays are copied unto the other ones during the assignment of the first one to the others. So printing out the values result in the printing of the new replaced information. Bottom line is this when u pass arrays u are sending not a copy but the actual parameters which results in the change. Hope u understand. Fellow programmers plz correct me if i am wrong.... Saheed Adepoju SCJP 1.4(Coming real soon..) Imagination is better than knowledge..