Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

Have Programming Question? Ask it here!
 
 
 


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


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


Advertisement
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 Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com