Answer the question
In order to leave comments, you need to log in
How to copy an array to an object (ArrayStoreException)?
public class Class1 implements Interface1 {
public final Object[] Generator(int min, int max, int kol) {
Object[] MasO = new Object[kol];
double[] MasD = new double[kol];
Random R = new Random();
for (int i = 0; i < kol; i++)
{
MasD[i] = R.nextDouble();
}
Arrays.sort(MasD);
System.arraycopy(MasD, 0, MasO, 0, kol);
// MasO = MasD.clone();
return MasO;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question