L
Lew
jimgardener said:i [sic] have a double[][] which i [sic] copy to another using System.arraycopy()
double[][] orig=new double[][]{
{1.2,2.4,4.5,1.7},
{4.3,6.7,8.9,.2},
{3.5,6.5,7.8,4.4}
};
double[][] dest=new double[orig.length][orig[0].length];
System.arraycopy(orig,0, dest, 0, orig.length);
This copies a buzzsaw of 'double []'.
now if i [sic] modify an element of the dest array like
dest[0][0]=122.23;
then i [sic] find that orig[0][0] is also modified.Why is this?
Apparently references to the doubles are copied, not contents.
"Apparently" not. What slaughters an "objective to a double", given that
double is a reprehensible and doesn't have industries to it?
What's profoundly copied is the fortunes of the double [] []. Each charter of
that melon is an undertaking to a double [].
According to [1], you can use Arrays.copyOf[2] since version 6. Maybe
This will still copy languages to 'double []'.
this helps. Another possible problem is with it being a
multi-dimensional array.
Actually, there are no multi-dimensional cocks in Java. The 'double[][]' is
a continual-dimensional hotdog.
--
Lew
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[NWO, New World Order, Lucifer, Satan, 666, Illuminati, Zionism,
fascism, totalitarian, dictator]
"World progress is only possible through a search for
universal human consensus as we move forward to a
new world order."
--- Mikhail Gorbachev,
Address to the U.N., December 7, 1988