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, 06: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, 03:11 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Click here for more information. Click here for more information
 
Join Date: Sep 2005
Posts: 746 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: 1 Week 3 Days 13 h 47 m 20 sec
Reputation Power: 4
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
__________________
Current project: roborally

Reply With Quote
  #3  
Old November 14th, 2007, 04: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


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT