Home Answers Viewqa JSP-Servlet how to create month wise serial number in java?

 
 


rakesh dilip patil
how to create month wise serial number in java?
1 Answer(s)      a year 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++){
              serialNo++;
          System.out.printf("1/%03d\n",  serialNo);
         }
       }
     }









Related Pages:

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.