|
|
|
|
Welcome to the Java Forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:
- have access to post topics
- communicate privately with other members (PM)
- not see advertisements between posts
- have the possibility to earn one of our surprises if you are an active member
- access many other special features that will be introduced later.
Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact us.
|
|

08-08-2008, 01:22 PM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 20
|
|
|
[SOLVED] auto generated numbers
hi all
i need java code to auto generate numbers in seial order..pls find a code...
|
|

08-08-2008, 05:44 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,225
|
|
What does that mean? Can you give an example?
|
|

08-08-2008, 11:01 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Posts: 533
|
|
|
for (int i =0; i < Max; i++) {
/// use i for something
}
|
|

08-11-2008, 10:23 AM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 20
|
|
|
its generating number automatically whenever we log into one page...i have code to generate in random way..but i need in serial order
|
|

08-11-2008, 02:25 PM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Still not clear what you are looking. You can randomly generate a number, but what you mean serial order?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

08-11-2008, 03:56 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,225
|
|
|
new number = old number + 1
This generates numbers in serial order.
|
|

08-11-2008, 09:41 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Posts: 533
|
|
Originally Posted by suprabha
i have code to generate in random way..but i need in serial order
You are not explaining your question well. It is impossible to have "random" numbers be in sequential order. Something has to change, you have conflicting requirements.
|
|

08-12-2008, 05:21 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 5,075
|
|
|
Yes it is. May be he's looking to order them in acceding or descending order. But it's not possible with random numbers. But you can tricky there. Each random number store in an array list, and just after adding number to the list sort the list. But this is useless because waste lots of resources. Just think what happened if you need 1000 random numbers.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Someone helped you? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post. Help: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Resources: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Web: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. Tips: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

08-12-2008, 04:45 PM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Location: Southwest
Posts: 880
|
|
|
psuedo random?
Originally Posted by fishtoprecords
.... It is impossible to have "random" numbers be in sequential order. .....
Psuedo-random probably, your the master so suggest original poster read the docs for Random.next.... Likely will do what is needed. identical sequences of numbers
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. .
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
|
|

08-13-2008, 10:05 AM
|
|
Member
|
|
Join Date: Jul 2008
Posts: 20
|
|
|
thank you all for responding..i got the solution
|
|

08-14-2008, 07:13 AM
|
 |
Senior Member
|
|
Join Date: Jun 2008
Posts: 533
|
|
Originally Posted by suprabha
..i got the solution
You should post your solution so others with the same problem can learn as well
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
All times are GMT +3. The time now is 09:30 AM.
|
|
VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org