Java TimeUnit.values()

Syntax

TimeUnit.values() has the following syntax.

public static TimeUnit [] values()

Example

In the following code shows how to use TimeUnit.values() method.


import java.util.concurrent.TimeUnit;
/*ww  w . ja  v  a2 s .c o  m*/
public class Main {
  public static void main(String[] args)throws Exception {
    TimeUnit[] timeUnits = TimeUnit.values();
    for(TimeUnit unit:timeUnits){
      System.out.println(unit);
    }
  }
}




















Home »
  Java Tutorial »
    java.util.concurrent »




ArrayBlockingQueue
BlockingDeque
CountDownLatch
CyclicBarrier
TimeUnit