This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Another question regarding arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Another question regarding arrays" Watch "Another question regarding arrays" New topic
Author

Another question regarding arrays

Ben Buchli
Ranch Hand

Joined: Mar 26, 2004
Posts: 83
Hi everybody,

is

int[] newArray = arrayReferencePassedAsMethodParameter.clone();

equals to copying the returned array into a new array? I mean, do I make sure that I dont refer to the reference that could be modified somewhere else?

Thanks in advance,
Ben
Hari Gangadharan
Ranch Hand

Joined: Mar 08, 2001
Posts: 73
Yep. It is safe as long as it is an array of primitive datatypes.


<B>Hari Gangadharan</B><BR>Unix is user friendly..<BR>but it chooses to whom it is friendly with!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Another question regarding arrays
 
Similar Threads
how many objects will be created.
Multi Dimension Array Storing
WA #1.....word association
Sorting an Array
Widening Reference Conversation