rakesh dilip patil
how to create month wise serial number in java?
1 Answer(s)      4 years and 4 months ago
Posted in : JSP-Servlet

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++){
          System.out.printf("1/%03d\n",  serialNo);