How to Generate Unique ID in Java (Integer)?

后端 未结 9 1522
生来不讨喜
生来不讨喜 2020-12-06 04:11

How to generate unique ID that is integer in java that not guess next number?

9条回答
  •  醉话见心
    2020-12-06 05:02

    Unique at any time:

    int uniqueId = (int) (System.currentTimeMillis() & 0xfffffff);
    

提交回复
热议问题