java.util.UUID.equals(Object obj) 方法示例


java.util.UUID.equals(Object obj) 方法示例

package com.codingdict;

import java.util.*;

public class UUIDDemo {
   public static void main(String[] args) {

      // creating two UUIDs      
      UUID u1 = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
      UUID u2 = UUID.fromString("38400001-8cf0-11bd-b23e-10b96e4ef00d");

      // checking equality
      System.out.println("Is two UUIDs equal: "+u1.equals(u2));    
   }    
}