How to generate a new guid or UUID in Java

Java generate new UUID

                    //import required
                    import java.util.UUID;


                    //generate a new guid with value
                    UUID uuid = UUID.randomUUID();


                    //get the guid value as string
                    String randomUUIDString = uuid.toString();


                    //if you need an empty UUID (all zeros)
                    java.util.UUID uuidEmpty = new UUID( 0L , 0L );


How to generate a UUID with our tools