permaculture playing cards*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

coding problem

fozia inam
Greenhorn

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

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())
Dave.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
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.

JavaBeginnersFaq
"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
Rancher

Joined: Mar 06, 2001
Posts: 13459

this thread continued here.
Dave.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
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