Results 1 to 4 of 4
Thread: Random numbers
- 06-14-2008, 06:50 AM #1
Member
- Join Date
- Jun 2008
- Posts
- 39
- Rep Power
- 0
- 06-14-2008, 11:10 AM #2
- 06-14-2008, 11:32 AM #3
Member
- Join Date
- Jun 2008
- Posts
- 39
- Rep Power
- 0
Thank q Mr.sukatoa...i saw that but i want random alphanumeric values...... pls help me......
-
Ah, the dreaded "requirement creep". You will do better here to post your full requirements at the beginning of the thread rather than later. What you may do here is create a random number between say 33 and 126 and then cast the number to a char.i saw that but i want random alphanumeric values
for instance:
Java Code:int delta = '~' - '!' + 1; // the difference between the top and bottom ascii character Random random = new Random(); for (int i = 0; i < 500; i++) { char randomChar = (char)(random.nextInt(delta) + '!'); System.out.print(randomChar + " "); if ((i+1) % 20 == 0) { System.out.println(); } }
Similar Threads
-
random numbers without random class`
By carlos123 in forum New To JavaReplies: 4Last Post: 01-17-2008, 10:44 PM -
random numbers
By carlos123 in forum New To JavaReplies: 1Last Post: 12-22-2007, 02:56 AM -
Math.Random
By Java Tip in forum Java TipReplies: 0Last Post: 11-23-2007, 02:09 PM -
random numbers without using java funtions
By carlos123 in forum New To JavaReplies: 8Last Post: 11-16-2007, 10:13 AM -
generating random numbers in a 5x5 array.
By acidacid in forum New To JavaReplies: 3Last Post: 08-14-2007, 03:44 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks