Problem statement:
You are given a date. You just need to write the method, , which returns the day on that date.
For example, if you are given the date August 14th 2017 the method should return MONDAY as the day on that date.
You are given a date. You just need to write the method, , which returns the day on that date.
For example, if you are given the date August 14th 2017 the method should return MONDAY as the day on that date.
- public static String findDay(int mm, int dd, int yy)
- {
- java.time.LocalDate dt = java.time.LocalDate.of(yy, mm, dd);
- return dt.getDayOfWeek().name();
- }
Output: MONDAY
No comments:
Post a Comment