private String generateSerialNumber(String str){
  int value=str.hashCode();
  String serialNumber=null;
  if (value < 0) {
    value=-value;
    serialNumber=String.format("%010d",value);
    serialNumber="1" + serialNumber;
  }
 else {
    serialNumber=String.format("%011d",value);
  }
  return serialNumber;
}

private String generateSerialNumber ( String str ) { int value = str . hashCode ( ) ; String serialNumber = null ; if ( value < 0 ) { value = - value ; serialNumber = String . format ( "%010d" , value ) ; serialNumber = "1" + serialNumber ; } else { serialNumber = String . format ( "%011d" , value ) ; } return serialNumber ; }
generate serial number which will be of 11 digits .
