Java UUID getMostSignificantBits()方法及示例
UUID类getMostSignificantBits()方法
getMostSignificantBits()方法在java.util包中可用。
getMostSignificantBits()方法用于获取这128位中的最高64位。
getMostSignificantBits()方法是一种非静态方法,仅可通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。
getMostSignificantBits()方法在获取最高有效位时不会引发异常。
语法:
public long getMostSignificantBits();
参数:
它不接受任何参数。
返回值:
该方法的返回类型很长,它返回这128位中的最高有效64位。
示例
//Java程序演示示例
//getMostSignificantBits()UUID的长方法的说明
import java.util.*;
public class GetMostSignificantBitsOfUUID {
public static void main(String[] args) {
//实例化UUID-
UUID uuid = UUID.fromString("46400000-8cc0-11bd-b43e-10d46e4ef14d");
//通过使用getMostSignificantBits()方法
//是要返回最高有效位
long most_sb = uuid.getMostSignificantBits();
//显示most_sb-
System.out.println(" uuid.getMostSignificantBits(): " + most_sb);
}
}输出结果
uuid.getMostSignificantBits(): 5062045983525835197
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短