Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 18th, 2007, 05:59 PM
skinnybenny skinnybenny is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 8 skinnybenny User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 19 sec
Reputation Power: 0
Generate random number between 1000 and 9999

im super frustrated. question is in the title. thanks so much to whoever helps me out. i just dont know how to do it.

Reply With Quote
  #2  
Old September 19th, 2007, 02:11 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 7 h 49 m 32 sec
Reputation Power: 10
I made a quick test, hope it helps you:

java Code:
Original - java Code
  1. import java.io.*; 
  2. import java.lang.*; 
  3. import java.util.Random;   
  4.  
  5. class Test 
  6. {       
  7.    public static void main(String[] args) throws Exception     
  8.    {     
  9.       for(int i=0; i<50; ++i)    
  10.       {           
  11.          System.out.println("" + (new Random().nextInt(9999-1000)+1000));
  12.       }
  13.    }
  14. }


Good luck
__________________
There is no such thing as C/C++, you either program C or C++

Reply With Quote
  #3  
Old November 14th, 2007, 03:37 PM
skinnybenny skinnybenny is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 8 skinnybenny User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 44 m 19 sec
Reputation Power: 0
yeah,
thank you for the help

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > Generate random number between 1000 and 9999


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap