Java Date Time - DayOfWeek SATURDAY example








DayOfWeek SATURDAY defines the instance for the day-of-week of Saturday. This has the numeric value of 6.

Syntax

SATURDAY has the following syntax.

public static final DayOfWeek SATURDAY

Example

The following example shows how to use SATURDAY.

import java.time.DayOfWeek;
// w w w  . j  a  v  a  2  s  .c om
public class Main {
  public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.SATURDAY;
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
  }
}

The code above generates the following result.