how to create month wise serial number in java?

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
ModuleNotFoundError: No module named 'javax'
ModuleNotFoundError: No module named 'javax'
How can I master Java in one month?
How to format number in Java?
Javap Tool application
How do you master python in a month?
how to generate bank account number?
Artifacts of javax
Maven dependency for com.gooddata - gooddata-http-client version 1.0.0+java7 is released. Learn to use gooddata-http-client version 1.0.0+java7 in Maven based Java projects
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.
how i get experience wise resume from database when i submit from browser
Java Number Spiral
How to generate random number in java
ModuleNotFoundError: No module named 'wise'
ModuleNotFoundError: No module named 'wise'
how to display(update) current date and month in select box on selecting the year.
How to format number in Java?
Find Day of Month
how to get number of shards in elasticsearch
how to validate national ID number
how to auto generate number in jsp with the database connection mysql for employee number?
how to auto generate number in jsp with the database connection mysql for employee number?
how to create a xml page
Javah -  Header File Generator

Ads