I need to make a program that populates an array with randoms numbers between 25 and 80 then uses another for loop to print the results on a new line each time. I'm not sure why I get some output and then errors in this code.
int[] myIntArray = new int [20];
Random r = new Random();
for (int i = 0; i <= 20; i++){
int rand = r.nextInt(80 - 25) + 25;
myIntArray[i] = rand;
}
for (int i = 0; i <= 20; i++){
System.out.println(myIntArray[i]);
}