- Joined
- Jan 8, 2022
- Messages
- 11
- Reaction score
- 0
i need help. i am trying to generate 2000 numbers between the values of 10 and 30, then use a one dimensional array to record the frequency of each numbers.
problem is, i am very confused and dont know how to do this. how do i do this? here is the code.
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
double[] arr = new double[2000];
Random randNum = new Random();
for (int i = 0; i < 2000; i++) {
arr = randNum.nextInt();
}
}
}
problem is, i am very confused and dont know how to do this. how do i do this? here is the code.
import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;
class Main {
public static void main(String[] args) {
double[] arr = new double[2000];
Random randNum = new Random();
for (int i = 0; i < 2000; i++) {
arr = randNum.nextInt();
}
}
}