Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
Beginning Java
Another question regarding arrays
Ben Buchli
Ranch Hand
Posts: 83
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 73
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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!
Good night. Drive safely. Here's a tiny ad for the road:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Shuffling array of ints
How to make a deep copy of a multidimensional int array?
Array.clone() not producing a distinct copy?
delete an element from an array
Increasing Array Size
More...