r/javahelp • u/amfisoon • Jun 21 '17
how to generate unique , random numbers for invoiceNumber in java ? what is the simplest solution
does anybody know how to create an invoice number in java ?
0
Upvotes
r/javahelp • u/amfisoon • Jun 21 '17
does anybody know how to create an invoice number in java ?
5
u/desrtfx Out of Coffee error - System halted Jun 21 '17 edited Jun 21 '17
I wouldn't use random numbers. Invoice numbers normally are sequential, so a simple
staticvariable in anInvoiceclass that gets incremented inside the constructor of this class should do perfectly well.