FileDocCategorySizeDatePackage
UUID.javaAPI DocExample2822Sun Feb 08 21:34:08 GMT 2004None

UUID

public class UUID extends Object
Show generation of a unique identifier

Fields Summary
static int
num
A sequence number
static Random
r
A Random generator
Constructors Summary
Methods Summary
static synchronized java.lang.StringgetUUID()
Generate a new UUID. Uses both num and r; easier to synchronize the method than the two access/modifies.


	                  	 
	    
		return "o-" + ++num + "-" + r.nextLong();
	
public static voidmain(java.lang.String[] args)

		System.out.println(getUUID());