DayOfWeek THURSDAY example

Description

DayOfWeek THURSDAY defines the instance for the day-of-week of Thursday. This has the numeric value of 4.

Syntax

THURSDAY has the following syntax.


public static final DayOfWeek THURSDAY

Example

The following example shows how to use THURSDAY.


import java.time.DayOfWeek;
/*  w  w  w .  j a v  a 2  s  .  c o m*/
public class Main {
  public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.THURSDAY;
    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