比如id设置成xxx+0001,且0001是递增的,那么0001如何递增为0002呢,方法如下:
DecimalFormat decimalFormat = new DecimalFormat("0000");  //代表四位数
String maxSerialNumber = decimalFormat.format(Integer.parseInt("0001") + 1);  //转为String之后的结果是0002而不是2

 

相关文章:

  • 2021-08-02
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2021-08-30
  • 2021-11-14
  • 2021-06-28
  • 2021-12-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-02-04
相关资源
相似解决方案