public class Generator {
static Random rnd= new Random();
private static void generator() {
double zahl = 0;
double min = 0.0;// minimum number
double max = 1.0;// maximal number
int x = 0; // number of numbers you want to output
System.out.print("How many numbers: ");
x = Eingabe.liesInt(); //User-input of the numbers
rnd.setSeed(123423);
for (int i = 0; i < x; i++) {
zahl = (int) ((rnd.nextDouble() * ((max - min) + 1) + min));
System.out.println(zahl);
}
System.out.println();
}
/*
* Standard-Constructor
*/
public static void main(String[] args) {
generator();
}
}
Can somebody help me? What is wrong with tis code? I want to get numbers between 0.0 and 1.0! The only numbers I get are really 0 and 1, but I also want numbers between!!!