Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys, I want to print the series of numbers but if its less then 9 it should print 09 other then that if its more then 9, I don't want 0 add to the integar e.g. series of number I want is 03 06 09 15 20 22

Also there is a method in java that sorts an array?? Could any one here let me know which one is it ?? As far as I know its something.Sort();

Thanks in advance.
Posted
Updated 20-Jul-12 3:47am
v2

 
Share this answer
 
Comments
Salman Ali Hero 20-Jul-12 22:09pm    
this has too much information, could you tell me in short words if its correct %02d
Mehdi Gholam 21-Jul-12 3:08am    
Yes that is correct, you can always check in your debugger :)
Salman Ali Hero 21-Jul-12 22:07pm    
System.out.print(randomGenerate + " ");
randomGenerate is my integar but when I added %02d infront of it, it's giving me errors... :(
Mehdi Gholam 22-Jul-12 2:41am    
System.out.print("%02d", randomGenerate);
Salman Ali Hero 22-Jul-12 5:27am    
yeah I tried that before but still not working...
As for the sorting part, Arrays.Sort(yourArray) should work according to the first result[^] on Google when searching for "java sort array".
 
Share this answer
 
Comments
Salman Ali Hero 21-Jul-12 22:08pm    
Thanks man, keep it up !!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900