我有一个数组的问题,并将它们分配给像float这样的值.这是我的代码
System.out.print("Please enter the number of iteration: ");
Scanner scn = new Scanner(System.in);
int inumber = scn.nextInt(); // i get the iteration number
Random rnd = new Random();
float x = -10 + rnd.nextFloat() * 20; // i created random number between 10 and -10
System.out.println("My x = " +x);
float[] xarray = new float[4]; // created my test array
Random arrayrnd = new Random();
for (int i=0;i<inumber;i++) { // created a for loop with that number
for (int j …Run Code Online (Sandbox Code Playgroud)