Javatpoint Logo
Javatpoint Logo

Java Date getDay() Method

The getDay() method of java date class returns the value between 0 to 6 which represents the day of the week by this date object.

Value Day
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

This method is deprecated as of JDK version 1.1 and replaced by Calender.get(Calender.DAY_OF_WEEK)

Syntax:

Parameters

NA

Return

It returns the day of the week represented by this date object.

Example 1

Test it Now

Output:

day of the week is  : 3

Next TopicJava Util Date





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA