Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do i choose a random Integer Object  RSS feed

 
Jere Johnson
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would i execute a random number for an Integer
array?
thanks for the help

[ December 02, 2003: Message edited by: Jere Johnson ]
 
Martin Coetzee
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!