View Single Post
  #7 (permalink)  
Old 11-16-2007, 01:01 AM
lk9865 lk9865 is offline
Member
 
Join Date: Nov 2007
Posts: 8
lk9865 is on a distinguished road
Quote:
Originally Posted by hardwired View Post
Can you use the java.util.Random class?
Edit: random numbers without using java funtions
aha - no java. Check the next method in the Random class for some clues.
carlos,
just like hardwired said there is another java class called Random you can upload before your programs you try something like this
Code:
java.util.Random; public class RandomProject{ public staid void main(strings[] args){ Random generator = new Random(); //give a object name for the class for(int i=0; i<=100; i++){ int randomNumbers = generator.nextInt(20);//will generate numbers from1-20 System.out.println(randomNumbers); } } }
there you go you have now generated 100 random numbers between 1 and 20 hope this helps
Reply With Quote