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?
Java2
Advertisements
Javah
How to Addding One Month with PHP ?
How to learn Java programming in a month
How to format number in Java?
How can I master Java in one month?
Java Number Spiral
how to generate bank account number?
how to create notepad in java
how to create frame in swings
How to get month name from date(like-25/06/2012) using java?
ModuleNotFoundError: No module named 'javax'
ModuleNotFoundError: No module named 'javax'
how to show x axis values of timeline chart in jfreechart with particular month.
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.
How to create form in Swings
How to create a class in java
how to create web aplli
how to create web aplli
how i get experience wise resume from database when i submit from browser
How to Create Keyboard in JAVA
Javap Tool application
how to create a table
How to format number in Java?
How To Create a Table.
how to create rdd in pyspark
how to get number of shards in elasticsearch
how to create uiwebview programmatically

Ads