[[5, 2, 1, 1], [2, 1, 1]] としてデータを含む「link_occur_nodup」という 2 次元ベクトルがあります。今、私がやろうとすると
Vector<Vector<Integer>> temp=(Vector<Vector<Integer>>) link_occur_nodup.clone();
temp.elementAt(0).set(1, 50);
System.out.println(temp+" "+link_occur_nodup);
出力は次のとおりです。 [[5, 50, 1, 1], [2, 1, 1]] [[5, 50, 1, 1], [2, 1, 1]] なぜ値が変更されるのか疑問に思っています両方のベクトルで?代わりに、「一時」ベクトルにのみ存在する必要があります。誰か説明してくれませんか?