Hi i m new in java..
i have to solve this..
write a programme to display random choice from a set of six choices,scrambled, eggs, waffles etc.....
kindly help me....i m having huge problem...
Regards..
Farhad
Farhad.idrees
1
Junior Poster in Training
Recommended Answers
Jump to PostHi,
You could have a look at the Random class, especially the nextInt() and nextInt( int arg0 ) methods.
Hope this helps.
Edit: here's the API for it: http://download.oracle.com/javase/1.4.2/docs/api/java/util/Random.html
Jump to Postalso you could use an array to contain your choices and use the random number to index into the array.
All 6 Replies
masterofpuppets
NormR1
563
Posting Sage
Team Colleague
sirlink99
56
Practically a Master Poster
Farhad.idrees
1
Junior Poster in Training
NormR1
563
Posting Sage
Team Colleague
sirlink99
56
Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.