How to generate random with UUID.randomUUID() in Java

1 Answer

0 votes
package javaapplication1;

import java.util.UUID;
 
public class Example {
    public static void main(String[] args) {
       
        String uuid = UUID.randomUUID().toString();
        System.out.println(uuid);
    }
}
 
/*
run:
  
a0d31cc4-e107-404d-86d4-c0198e298aa5
  
*/

 



answered Apr 7, 2016 by avibootz

Related questions

1 answer 143 views
143 views asked Mar 29, 2021 by avibootz
1 answer 153 views
153 views asked Mar 21, 2021 by avibootz
1 answer 119 views
119 views asked Aug 15, 2023 by avibootz
1 answer 131 views
131 views asked Aug 15, 2023 by avibootz
1 answer 131 views
131 views asked Aug 15, 2023 by avibootz
1 answer 239 views
...