DayOfWeek TUESDAY example

Description

DayOfWeek TUESDAY defines the instance for the day-of-week of Tuesday. This has the numeric value of 2.

Syntax

TUESDAY has the following syntax.


public static final DayOfWeek TUESDAY

Example

The following example shows how to use TUESDAY.


import java.time.DayOfWeek;
/* www.  ja va2s .c  o m*/
public class Main {
  public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.TUESDAY;
    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