开发者

Set private integer to another private integer

How do you set the value of one private integer to another? i.e:

private Integer [] mOne = {R.string.1, R.string.2};

to be-->

开发者_开发技巧private Integer [] mTwo = {Integer mOne[]};

except that code doesn't work. the point being to have mTwo = {R.string.1,R.string.2} without having to explicitly write that...

I know what I want to say, just don't know how to say it! thanks for your help


private Integer[] mTwo = mOne;

This creates a reference. If you need a copy:

private Integer[] mTwo = mOne.clone();


This should work:

private Integer [] mTwo = mOne;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜