This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes coding problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

coding problem

fozia inam

Joined: Nov 27, 2001
Posts: 4
could anybody tell me the coding for storing 20 unique random numbers in an array.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

This sounds like homework (there is an unofficial policy of not giving complete homework solutions)
You need to instatiate an array of integers large enough to hold 20 items
You need to loop through the list and put a new random integer in each slot (see java.util.Random.nextInt())
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9044
We don't want to rob you of an education by writing the solution for you. Show us what you have and tell us what's not working. Ask a specific question. Then we can help you.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

this thread continued here.
Don't get me started about those stupid light bulbs.
subject: coding problem
Similar Threads
Url cannot be null error :(
WA #1.....word association
conditional select stmt problem in java servlet
SCJP 1.4 exam: Threads
Suggestion required