It's not a secret anymore!
The moose likes Beginning Java and the fly likes How do i choose a random Integer Object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How do i choose a random Integer Object" Watch "How do i choose a random Integer Object" New topic
Author

How do i choose a random Integer Object

Jere Johnson
Greenhorn

Joined: Mar 29, 2003
Posts: 28
How would i execute a random number for an Integer
array?
thanks for the help

[ December 02, 2003: Message edited by: Jere Johnson ]

Diapers are the best invention
Martin Coetzee
Greenhorn

Joined: Dec 02, 2003
Posts: 21
Try This...
Integer [ ] data = new Integer [10};
java.util.Random random = new java.util.Random();
for (int i=1; i<data.length; i++){
data[i] = new Integer(random.nextInt());
}
Greetings from South Africa
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How do i choose a random Integer Object
 
Similar Threads
Regarding PriorityQueue
about random.next int();
Getting return value using Callable and Future