Java – UUID Class

Java UUID Class methods, constructors, variables available in Java 8 release are listed below. We will publish example program on each methods ASAP.

Constructors in Java UUID Class

S.No Constructor & Description
1 UUID(long mostSigBits, long leastSigBits)

Constructs a new UUID using the specified data.

Methods in Java UUID Class

S.No Method & Description
1 int clockSequence()

The clock sequence value associated with this UUID.
2 int compareTo(UUID val)

Compares this UUID with the specified UUID.
3 boolean equals(Object obj)

Compares this object to the specified object.
4 static UUID fromString(String name)

Creates a UUID from the string standard representation as described in the toString() method.
5 long getLeastSignificantBits()

Returns the least significant 64 bits of this UUID’s 128 bit value.
6 long getMostSignificantBits()

Returns the most significant 64 bits of this UUID’s 128 bit value.
7 int hashCode()

Returns a hash code for this UUID.
8 static UUID nameUUIDFromBytes(byte[] name)

Static factory to retrieve a type 3 (name based) UUID based on the specified byte array.
9 long node()

The node value associated with this UUID.
10 static UUID randomUUID()

Static factory to retrieve a type 4 (pseudo randomly generated) UUID.
11 long timestamp()

The timestamp value associated with this UUID.
12 String toString()

Returns a String object representing this UUID.
13 int variant()

The variant number associated with this UUID.
14 int version()

The version number associated with this UUID.

Ask your questions in eHowToNow Forum

Post your technical, non-technical doubts, questions in our site. Get answer as soon as possible, meanwhile you can help others by answering, unanswered questions.
To Ask new Question : Ask Question
Check our existing discussions : Questions & Answers

  1. Java – ThreadPoolExecutor.CallerRunsPolicy Class
  2. Java – PrimitiveIterator Interface
  3. Java – LongAdder Class
  4. Java – AbstractCollection Class
  5. Java – Scanner Class
  6. Java – AbstractMap.SimpleEntry Class
  7. Java – AtomicStampedReference Class
  8. java.util Package
  9. Java – DelayQueue Class
  10. Java ArrayList isEmpty() method with example
  11. Java – CountDownLatch Class
  12. Java – IntBinaryOperator Interface
  13. Java – WeakHashMap Class
  14. Java – ConcurrentLinkedQueue Class
  15. Java – Spliterators.AbstractDoubleSpliterator Class

Be the first to comment

Leave a Reply