UUID variant() Method in Java with Examples
Every UUID has a variant number describing the generation of this UUID. The variant() method of UUID class in Java is generally used to get variant number associated with this UUID.
public int variant()
Parameters: This method does not take any parameter.
Return Value: This method returns a int value which is the variant number associated with this UUID.
Below programs illustrate the working of variant() method:
UUID: 58e0a7d7-eebc-11d8-9669-0800200c9a66 The variant number is: 2
UUID: 5fc03087-d265-11e7-b8c6-83e29cd24f4c The variant number is: 2