Java Data Type Tutorial - Java UUID.getMostSignificantBits()








Syntax

UUID.getMostSignificantBits() has the following syntax.

public long getMostSignificantBits()

Example

In the following code shows how to use UUID.getMostSignificantBits() method.

/*ww w  .j a  va 2  s.  com*/

import java.util.UUID;

public class Main {
   public static void main(String[] args) {
      // creating UUID      
      UUID uid = UUID.randomUUID();     
        
      // checking most significant bits
      System.out.println("Most significant bits: "+uid.getMostSignificantBits());    
   }    
}

The code above generates the following result.