DayOfWeek SATURDAY example

Description

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;
/*from www .j  a v  a  2s.  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.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset