- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHackerrankJava0011.java
More file actions
Latest commit
20 lines (15 loc) · 586 Bytes
/
Copy pathHackerrankJava0011.java
File metadata and controls
20 lines (15 loc) · 586 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
importjava.util.Calendar;
importjava.util.Locale;
publicclassHackerrankJava0011 {
publicstaticvoidmain(String[] args) {
// Java Date and Time
// https://www.hackerrank.com/challenges/java-date-and-time/problem?isFullScreen=true
StringdayOfTheWeek = findDay(8, 5, 2015);
System.out.println(dayOfTheWeek);
}
publicstaticStringfindDay(intmonth, intday, intyear) {
Calendarcalendar = Calendar.getInstance();
calendar.set(year, month - 1, day);
returncalendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.getDefault()).toUpperCase();
}
}