package test;
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
double[] myList=new double[10];
System.out.println("enter values");
for (int i = 1; i < myList.length; i++) {
java.util.Scanner input=new java.util.Scanner(System.in);
int j = (int)Math.random() * myList.length;
double tmp=myList[j];
myList[i]=myList[j];
myList[j]=tmp;
System.out.println(tmp);
}
}
}
Warum druckt 0.0
?shuffling Zahlen im Array
Sie nie irgendwelche Werte im Array setzen sollten . Du tauscht einfach eine Menge '0.0' Doppel um. – CollinD
Haben Sie 'Scanner' Objekt' Input' (10 Mal erstellt) einmal verwendet? Der Standardwert von int ist 0 – GurV
Könnten Sie uns mehr Informationen als eine Methode und ihre Ausgabe liefern? –