d*******n 发帖数: 524 | 1 So far I don't know anyway to pass by value in Java. If I wanna use a local
copy, I do cloning in the method.
But just out of curious, is there a way to pass by value at all? | m******t 发帖数: 2416 | 2
local
Java _does_ pass by value all the time.
But I know what you mean. And no, there isn't a language feature
that automatically lets you pass a copy of an object, short of
having the caller explicitly cloning it.
【在 d*******n 的大作中提到】 : So far I don't know anyway to pass by value in Java. If I wanna use a local : copy, I do cloning in the method. : But just out of curious, is there a way to pass by value at all?
| T*o 发帖数: 363 | 3 java就是传值的阿
你是值对象拷贝吧,这个必须clone吧
local
【在 d*******n 的大作中提到】 : So far I don't know anyway to pass by value in Java. If I wanna use a local : copy, I do cloning in the method. : But just out of curious, is there a way to pass by value at all?
| d*******n 发帖数: 524 | 4 Yuh, sorry that I forgot to say I was talking about object......
【在 m******t 的大作中提到】 : : local : Java _does_ pass by value all the time. : But I know what you mean. And no, there isn't a language feature : that automatically lets you pass a copy of an object, short of : having the caller explicitly cloning it.
| t*******e 发帖数: 684 | |
|