AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Random Class with Stack Question

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Discussions
View previous topic :: View next topic  
Author Message
Jeremy
Guest





PostPosted: Sat Apr 14, 2007 8:51 pm    Post subject: Random Class with Stack Question Reply with quote



What's the best way to create a Stack class with random number and display
the number between 1 and 6?

i would think it would start with something like this:
Stack s= new Stack();
Random generator= new Random();

then inside the for loop
int randomIndex = generator.nextInt( i );

now.. from this point, I should be be able to display random number by using
Stack class with push and pop am I right?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Discussions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.