Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  
 

how to create month wise serial number in java?

Ads

 
 

Share on Google+Share on Google+

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

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

Ads
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:
Advertisements