import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
public class sample {
public static void main(String[] args) {
List list = new ArrayList();
for (int i = 0; i < 5; i++) {
list.add((float)Math.random() * 100);
}
Iterator i = list.iterator();
while (i.hasNext()) {
System.out.print(i.next() + "\t");
}
}
}
Output :
20.235153 18.181171 13.668783 54.82365 93.62838If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.