Check out example codes for "java unique id". It will help you in understanding the concepts better.

Code Example 1

String uuid = UUID.randomUUID().toString();

Learn ReactJs, React Native from akashmittal.com