Originally posted by sheng zhong: ... The output are same, it's different from C++ result. I think it's the reason about java passing by reference, not a copy. So how can I do to make it output 100 and 200?
Java does not pass by reference. It passes by value (reference copies).
I'm not sure what you mean by "make it output 100 and 200." Are you looking for something like this...?
Stree.get(0).get(0) Stree.get(1).get(1) [ April 26, 2008: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
Joined: Nov 23, 2006
Hi, sorry for the misunderstanding. I am looking for the result like this:
Stree 0 is [100.0] Stree 1 is [100.0] [200.0]
Since Svec changed before adding to Stree [ April 26, 2008: Message edited by: sheng zhong ]