由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Is there a way to pass by value in Java?
相关主题
copy constructor都什么时候be called啊immutable list
Java复制object[合集] 问一下这个cast在java里是怎么work的
git clones only one branch?[合集] 谁能解释一下这里的protected specifier
说说clone咋违反了类继承的原则来的?JAMWiki, anyone used it?
any clone of netbeans of look&feel?传递一个object reference,如何防止更改object?
怎样才能使一个算法用于不同的数据结构?请教: class private data member
Why Java needs clone interface?is there anyway that i can return...
clone() question 请问java property file的问题
相关话题的讨论汇总
话题: java话题: pass话题: value话题: way话题: cloning
进入Java版参与讨论
1 (共1页)
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
5
deep clone, deep copy
1 (共1页)
进入Java版参与讨论
相关主题
请问java property file的问题any clone of netbeans of look&feel?
再问一个怎样才能使一个算法用于不同的数据结构?
eclipse 里面的arguments怎么pass?Why Java needs clone interface?
java 的函数 xxx(a, b,c)能够向a 写入数据吗?clone() question
copy constructor都什么时候be called啊immutable list
Java复制object[合集] 问一下这个cast在java里是怎么work的
git clones only one branch?[合集] 谁能解释一下这里的protected specifier
说说clone咋违反了类继承的原则来的?JAMWiki, anyone used it?
相关话题的讨论汇总
话题: java话题: pass话题: value话题: way话题: cloning