Java DayOfWeek create from int value

Description

Java DayOfWeek create from int value

import java.time.DayOfWeek;

public class Main {
  public static void main(String[] args) {
    // Obtain a DayOfWeek instance using an int value
    DayOfWeek dw2 = DayOfWeek.of(7); // SUNDAY
    System.out.println(dw2);/*from w w w  .j a v a2  s. com*/
  }
}



PreviousNext

Related