public static void main(String[] args) {
List list = new ArrayList<>();
for (int i = 1; i <= 10; i++) {
list.add(Math.random() * 100);
}
for (Object temp:list){
System.out.println(temp);
}
}
import java.util.Random;
public class Program {
public static void main(String[] args){
Random rn = new Random();
int[] random = new int[10];
for(int i =1; i <= 10; i++)
{
random[i-1] = rn.nextInt(10);
System.out.println(random[i-1]);
}
}
}