how to create month wise serial number in java?

Ads
 

how to create month wise serial number in java?

Ex: For 1)January-serial number is 1/001,1/002,1/003 etc.

View Answers

May 30, 2012 at 4:40 PM

Sometimes, there is a need to generate the serial number of some format. The given code is doing the same. Here the code generates the serial number in 1/001, 1/002 like format.

   public class GenerateSerialNumber {

        public static void main (String args[]){

          int serialNo = 000;
          for (int i=0;i<12;i++){
              serialNo++;
          System.out.printf("1/%03d\n",  serialNo);
         }
       }
     }

Ads









Related Tutorials/Questions & Answers:
how to create month wise serial number in java?
Java get number of Days in Month
Advertisements
Java2
Javah
How to Addding One Month with PHP ?
How to learn Java programming in a month
How can I master Java in one month?
How to format number in Java?
Java Number Spiral
How do you master python in a month?
ModuleNotFoundError: No module named 'javax'
ModuleNotFoundError: No module named 'javax'
how to generate bank account number?
how to create frame in swings
how to create notepad in java
How to get month name from date(like-25/06/2012) using java?
how to show x axis values of timeline chart in jfreechart with particular month.
Javap Tool application
how i get experience wise resume from database when i submit from browser
How to generate random number in java
how to create session for login
how to display(update) current date and month in select box on selecting the year.
Artifacts of javax
Find Day of Month
How to create form in Swings
How to create a class in java
how to create web aplli
how to create web aplli
How to format number in Java?
How to Create Keyboard in JAVA
how to create a table

Ads